Skip to content

[FLINK-39491][runtime] move lineage Listener creation to Dispatcher#28002

Open
HuangZhenQiu wants to merge 2 commits intoapache:masterfrom
HuangZhenQiu:FLINK-39491-dispatcher-event
Open

[FLINK-39491][runtime] move lineage Listener creation to Dispatcher#28002
HuangZhenQiu wants to merge 2 commits intoapache:masterfrom
HuangZhenQiu:FLINK-39491-dispatcher-event

Conversation

@HuangZhenQiu
Copy link
Copy Markdown
Member

What is the purpose of the change

Currently, the job creation event happens in client side, and any follow up status change events propagation happen in DefaultExecutionGraph. In this case, there are two instances of the same job listener created. We probably may consider moving the job creation event to dispatcher. With the change, a single job listener instance for each type in JVM needs to be created. Then, states within the instance will be shared within the whole job lifecycle.

Brief change log

  • Move JobStatusChangedListener creation for Job Creation Event to Dispatcher
  • Change JobStatusChangedListener to singleton for each type in JobStatusChangedListenerUtils
  • Add test cases for JobStatusChangedListenerUtils.

Verifying this change

This change added tests and can be verified as follows:

  • JobStatusChangedListenerUtilsTest is added to test JobStatusChangedListener creation

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: (no)
  • The S3 file system connector: (no)

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?
  • Yes (please specify the tool below)

@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented Apr 22, 2026

CI report:

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

@HuangZhenQiu HuangZhenQiu force-pushed the FLINK-39491-dispatcher-event branch from 2740139 to 9048556 Compare April 22, 2026 23:22
@HuangZhenQiu
Copy link
Copy Markdown
Member Author

@flinkbot run azure

@HuangZhenQiu HuangZhenQiu force-pushed the FLINK-39491-dispatcher-event branch from 9048556 to 05af321 Compare April 23, 2026 05:14
@HuangZhenQiu
Copy link
Copy Markdown
Member Author

@flinkbot run azure

Comment thread flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java Outdated
@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Apr 27, 2026
@HuangZhenQiu
Copy link
Copy Markdown
Member Author

@flinkbot run azure

@HuangZhenQiu
Copy link
Copy Markdown
Member Author

@FangYongs @rmetzger
Would you please help to review this PR to improve the lineage listener?

@HuangZhenQiu HuangZhenQiu force-pushed the FLINK-39491-dispatcher-event branch from 8540e22 to fba8054 Compare April 27, 2026 03:33
@HuangZhenQiu HuangZhenQiu force-pushed the FLINK-39491-dispatcher-event branch from fba8054 to 57d1aa8 Compare April 27, 2026 05:59
@rmetzger
Copy link
Copy Markdown
Contributor

What are the use-cases of the job status listener?
For code using the flink cli to submit a job to a session cluster, the listener won't run on the cli anymore?
I worry that this change is breaking existing behavior for users

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.

4 participants