cjohnson-confluent opened a new pull request, #28555:
URL: https://github.com/apache/flink/pull/28555

   ## What is the purpose of the change
   
   `ExecutionStateUpdateListener`s registered on the `ExecutionGraph` are 
notified
   inline during `Execution.transitionState()`. When a listener reads
   `execution.getIOMetrics()` during a terminal state notification, it always
   gets null because `updateAccumulatorsAndMetrics()` is called *after*
   `transitionState()` in both `markFinished()` and `processFail()`.
   
   `completeCancelling()` already has the correct ordering -- metrics are stored
   before the state transition. This PR aligns the other two methods.
   
   ## Brief change log
   
   - `Execution.markFinished()`: move `updateAccumulatorsAndMetrics()` before
     `transitionState(current, FINISHED)`
   - `Execution.processFail()`: move `updateAccumulatorsAndMetrics()` before
     `transitionState(current, FAILED)`
   
   ## Verifying this change
   
   New test `testIOMetricsVisibleToListenersDuringStateTransition` in
   `DefaultExecutionGraphDeploymentTest` registers an 
`ExecutionStateUpdateListener`
   and asserts that `getIOMetrics()` is non-null (and correct) at notification 
time
   for both FINISHED and FAILED transitions.
   
   ## 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: no
   - The S3 file system connector: no
   
   ## Documentation
   
   - Does this pull request introduce a new feature? no


-- 
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]

Reply via email to