Skip to content

[FLINK-40602][runtime] JobManager silently omits running jobs whose JobMaster fails or times out on GET /jobs/overview - #29136

Open
sqd wants to merge 3 commits into
apache:masterfrom
sqd:FLINK-40602
Open

[FLINK-40602][runtime] JobManager silently omits running jobs whose JobMaster fails or times out on GET /jobs/overview#29136
sqd wants to merge 3 commits into
apache:masterfrom
sqd:FLINK-40602

Conversation

@sqd

@sqd sqd commented Sep 8, 2026

Copy link
Copy Markdown

What is the purpose of the change

GET /jobs/overview (backed by Dispatcher.requestMultipleJobDetails) queries every registered JobMaster, but it swallows any failure. A running job whose JobMaster fails or times out on requestJobDetails is therefore silently omitted while the request still succeeds. Clients that use /jobs/overview as the source of truth for job existence (e.g. the Flink Kubernetes Operator) conclude the job is gone.

This pull request makes requestMultipleJobDetails fail the whole request instead, with a FlinkException naming the job whose details could not be retrieved, so an incomplete view is never reported as a successful one.

Brief change log

  • Dispatcher.requestMultipleJobDetails no longer uses the failure-swallowing queryJobMastersForInformation; a failed requestJobDetails on any JobMaster fails the combined future
  • requestClusterOverview is unchanged (it only produces aggregate counts and keeps the lenient behaviour)
  • TestingJobManagerRunner.Builder gains setJobDetailsFutureFunction so a test runner can return a failed requestJobDetails future; the existing setJobDetailsFunction delegates to it

Verifying this change

This change added tests and can be verified as follows:

  • Added DispatcherTest#testRequestMultipleJobDetails_doesNotSilentlyOmitJobWhoseJobMasterQueryFails: registers two running jobs, one of whose JobMaster fails requestJobDetails with a TimeoutException, and asserts the request either fails or lists both jobs. The test fails on master (only one job returned) and passes with the fix.
  • Existing DispatcherTest#testRequestMultipleJobDetails_* tests continue to pass.

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 changed class annotated with @public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: yes
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code Fable 5.1

Han You added 2 commits September 8, 2026 14:18
…obDetails

A JobMaster whose requestJobDetails fails or times out is silently
omitted from the otherwise successful response, so clients conclude the
job is gone. This commit adds a failing test reproducing that.
…ery error

Currently a JobMaster whose requestJobDetails fails or times out is
dropped from the response while the request still succeeds, so clients
of /jobs/overview conclude the job is gone.

This commit fails the whole request instead, with an exception naming
the job whose details could not be retrieved.
@flinkbot

flinkbot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@spuru9 spuru9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments.

// silently left out: clients treat absence from this list as the job being gone.
final List<CompletableFuture<JobDetails>> individualJobDetails =
new ArrayList<>(jobManagerRunnerRegistry.size());
for (JobManagerRunner jobManagerRunner : jobManagerRunnerRegistry.getJobManagerRunners()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: This is the endpoint the Web UI job list polls too, not just the K8s operator. With this change, one running job whose JobMaster is briefly slow or times out on requestJobDetails now takes down the entire overview (500) instead of returning the other healthy jobs. For the operator, failing loudly is clearly the right call; for the UI it's a regression from "one job missing" to "whole page errors." Did you weigh that trade-off?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for taking a look! I think "one job missing silently" is dangerous not only for the operator, but also for an engineer who is using the UI to determine what to do. The engineer may draw wrong conclusion and actions from the UI. Failing loud as a 500 for now is an improvement in my opinion.

I agree with you that UX-wise this is a regression. I think something we can do in a followup PR, is to either cache previous good listing in the frontend, and show a banner along the line of "cannot contact jobmanager to update job list, what's currently shown may be stale", or render an empty job list with a similar message.

@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Sep 9, 2026
The test accepted any ExecutionException, so an unrelated failure would
pass it.

This commit asserts the failure names the job whose JobMaster could not
be queried.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants