[K8s] Fix failed application cancellation state race#4459
Open
johntomcat7408-cmyk wants to merge 1 commit into
Open
[K8s] Fix failed application cancellation state race#4459johntomcat7408-cmyk wants to merge 1 commit into
johntomcat7408-cmyk wants to merge 1 commit into
Conversation
johntomcat7408-cmyk
force-pushed
the
fix/4332-k8s-failing-cancel
branch
from
July 25, 2026 15:57
95c65bb to
73be3be
Compare
Allow failed Kubernetes applications to be canceled while protecting active and completed cancellation from stale watcher snapshots. Keep the database guard scoped so interrupted cancellation recovers after Console restart, explicit restarts and terminal corrections remain authoritative, and standalone savepoint completion remains unaffected. Refs apache#4332
johntomcat7408-cmyk
force-pushed
the
fix/4332-k8s-failing-cancel
branch
from
July 26, 2026 07:19
73be3be to
de2697c
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changes were proposed in this pull request
Issue Number: close #4332
Allow Kubernetes application jobs in
FAILINGstate to be canceled and make cancellation persistence robust to asynchronous watcher events both before and after terminal convergence.The persistence rules are deliberately scoped:
CANCELLINGwith option stateCANCELLINGorSAVEPOINTING, non-terminal watcher snapshots may refresh runtime metrics but cannot replace the main or option state.CANCELED, the mapper atomically rejects a late non-terminal metrics update. QueuedFAILING,RUNNING, orCANCELLINGsnapshots therefore cannot revert the terminal state or write their stale snapshot fields.STARTING, while interruptedCANCELLING/NONEand recoverableLOSTstates can still advance normally.SAVEPOINTING.Brief change log
RUNNINGandFAILINGapplications.CANCELED.LOSTrecovery, and standalone savepoint completion intact.Verifying this change
This change added tests and was verified as follows:
FlinkApplicationManageServiceTest: 12 tests run, 0 failures, 0 errors, and 1 pre-existing disabled integration test.FlinkJobStatusWatcherTest: 2 tests passed.verifycompiled main and test sources; Scalastyle processed 39 files with 0 errors and 0 warnings.git diff --checkpassed.Does this pull request potentially affect one of the following parts