roysti10 opened a new pull request, #1196:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1196
## What is the purpose of the change
Fixes FLINK-38290, a FlinkDeployment whose job has reached a globallly
terminal state falls back to RECONCILING and gets stuck there when the JM pod
is lost and recreated
## Brief change log
* JobStatusObserver#onTargetJobNotFound keeps the observed job state and
error when the job is already in a globally terminal state
* The Job Not Found warning event is skipped for terminal jobs and logged
instead
* The reconciliation state is still reset to DEPLOYED unconditionally, so a
pending upgrade is not blocked
## Verifying this change
This change added tests and can be verified as follows:
- Extended `testCancellingToMissing` so its 9 globally terminal parameter
rows assert the observed state, the error, and the absence of the warning event
- Added `testFinishedJobStateSurvivesJobManagerRestart` and
`testFailedJobStateSurvivesJobManagerRestart`: both submit an application
cluster, let the observer record the terminal state from the cluster, then drop
the job via `clearJobsInTerminalState()` to simulate the JobManager restart.
The failed case also asserts the recorded failure reason is not replaced by
`Job Not Found`
- Added `testMissingTerminalJobStillUnblocksPendingUpgrade`, which passes
with and without the fix by design — it guards the unconditional reconciliation
state reset rather than the bug
- Red/green: the 9 parameterized rows and the 2 new tests fail without the
fix and pass with it
- No `e2e-tests/` script was added; the scenario needs a JobManager pod
restart after job completion, and the unit tests reproduce it through the
store-clearing path
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / no) - no
- The public API, i.e., is any changes to the `CustomResourceDescriptors`:
(yes / no) - no
- Core observer or reconciler logic that is regularly executed: (yes / no)
- yes (Reconciller logic)
## Documentation
- Does this pull request introduce a new feature? (yes / no) -no
- If yes, how is the feature documented? (not applicable / docs / JavaDocs
/ not documented)
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes (please specify the tool below)
Generated-by: Claude Code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]