[FLINK-40003][runtime] Fix IOMetrics not visible to state transition listeners#28555
Open
cjohnson-confluent wants to merge 1 commit into
Open
[FLINK-40003][runtime] Fix IOMetrics not visible to state transition listeners#28555cjohnson-confluent wants to merge 1 commit into
cjohnson-confluent wants to merge 1 commit into
Conversation
…listeners Execution.markFinished() and processFail() called transitionState() before updateAccumulatorsAndMetrics(), so listeners notified inline during the transition always saw null from getIOMetrics(). completeCancelling() already had the correct ordering. Move updateAccumulatorsAndMetrics() before transitionState() in both methods to match. Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
spuru9
reviewed
Jun 27, 2026
spuru9
left a comment
Contributor
There was a problem hiding this comment.
Appears to be some issue with missing variables in the CI, can you check and fix those.
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.
What is the purpose of the change
ExecutionStateUpdateListeners registered on theExecutionGraphare notifiedinline during
Execution.transitionState(). When a listener readsexecution.getIOMetrics()during a terminal state notification, it alwaysgets null because
updateAccumulatorsAndMetrics()is called aftertransitionState()in bothmarkFinished()andprocessFail().completeCancelling()already has the correct ordering -- metrics are storedbefore the state transition. This PR aligns the other two methods.
Brief change log
Execution.markFinished(): moveupdateAccumulatorsAndMetrics()beforetransitionState(current, FINISHED)Execution.processFail(): moveupdateAccumulatorsAndMetrics()beforetransitionState(current, FAILED)Verifying this change
New test
testIOMetricsVisibleToListenersDuringStateTransitioninDefaultExecutionGraphDeploymentTestregisters anExecutionStateUpdateListenerand asserts that
getIOMetrics()is non-null (and correct) at notification timefor both FINISHED and FAILED transitions.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation