sqd opened a new pull request, #1215:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1215
## What is the purpose of the change
When a running session job is briefly missing from the JobManager's job
overview (for example during a JobManager HA failover), `JobStatusObserver`
sets `status.error` to `Job Not Found`. Once the job shows up again its state
goes back to `RUNNING`, but the error stays. When the `FlinkSessionJob` is
deleted later, `SessionJobReconciler.cleanupInternal` reads that stale error as
"the job is not running" and removes the finalizer without taking a savepoint
or cancelling the job. The job is left running unmanaged on the session
cluster. See FLINK-40810 for the full mechanism.
This change clears the `Job Not Found` error as soon as the observer finds
the job again, so the deletion path sees an accurate status.
## Brief change log
- `JobStatusObserver.observe` clears `JOB_NOT_FOUND_ERR` when the target
job is found again, before `updateJobStatus`, so a failure reason recorded for
a job that reappears as `FAILED` is kept
- All other errors are left unchanged
## Verifying this change
This change added tests and can be verified as follows:
- `JobStatusObserverTest#testJobNotFoundErrorClearedWhenJobIsFoundAgain`:
a savepoint-mode session job goes missing (it gets `Job Not Found` and
`RECONCILING`), then reappears on the cluster; the test checks it returns to
`RUNNING` with no error. It fails without the fix (`expected: <null> but was:
<Job Not Found>`).
- `JobStatusObserverTest#testOtherErrorsKeptWhenJobIsFound`: an error
other than `Job Not Found` is kept when the job is observed.
- `mvn clean verify` passes.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changes to the `CustomResourceDescriptors`:
no
- Core observer or reconciler logic that is regularly executed: yes (only
resets a known transient error when the job is observed again)
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: Claude Code Opus 5.5
--
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]