[FLINK-38870] Uninformative error message when job is suspended due to JobManager leadership loss#27463
Open
teamconfx wants to merge 2 commits intoapache:masterfrom
Open
[FLINK-38870] Uninformative error message when job is suspended due to JobManager leadership loss#27463teamconfx wants to merge 2 commits intoapache:masterfrom
teamconfx wants to merge 2 commits intoapache:masterfrom
Conversation
Collaborator
davidradl
reviewed
Jan 23, 2026
| jobStatus == null || jobStatus.isGloballyTerminalState(), | ||
| "jobStatus must be globally terminal or unknow(null)"); | ||
| jobStatus == null || jobStatus.isTerminalState(), | ||
| "jobStatus must be terminal or unknown(null)"); |
Contributor
There was a problem hiding this comment.
What does unknown(null) mean? Can we say null?
Author
There was a problem hiding this comment.
Yes thanks for pointing this out! I think null would be good enough! I will change this.
davidradl
reviewed
Jan 23, 2026
| new JobExecutionException( | ||
| jobId, | ||
| "Job completed with illegal status: " + jobStatus + '.', | ||
| "Job completed with unexpected status: " + jobStatus + '.', |
Contributor
There was a problem hiding this comment.
is jobStatus is null then this will look like null."some cause". If there no cause then we should not put out the . cause. I suggest to ternary ifs to deal with these situations.
Author
|
@davidradl Thank you so much for the review. Can you take a look at my new changes? |
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.
This PR fixes FLINK-38870.
Problem
When a JobManager loses leadership, jobs enter SUSPENDED state. The old error message "Job completed with illegal status: null" was uninformative and confusing.
Solution
My approach improves on the JIRA proposal by:
Files Modified
Job is in state SUSPENDED. This commonly happens when the JobManager lost leadership.
The job may recover automatically if High Availability and a persistent job store are configured.
If recovery is not possible (e.g., non-persistent ExecutionPlanStore), the job needs to be resubmitted.
Test Results
Error Message Comparison
Before:
After: