cjohnson-confluent opened a new pull request, #28760: URL: https://github.com/apache/flink/pull/28760
Backport of #28555 to release-2.0. ## What is the purpose of the change `Execution.markFinished()` and `processFail()` updated accumulators and IOMetrics after `transitionState()`, so `ExecutionStateUpdateListener`s notified inline during the transition saw null from `getIOMetrics()`. This backport applies the same fix as master: a `transitionToTerminalState()` method with a `preCompletionAction` callback that runs after the state is set but before `terminalStateFuture` is completed and listeners are notified. Applied to `markFinished()`, `processFail()`, `completeCancelling()` and `recoverExecution()`. ## Brief change log Cherry-pick of c0f774fdcefab05cf25c986effaad78fa5ecff2a from master (via the release-2.2 backport 7244dc10ea4). The production change in `Execution.java` is identical to master. The new test is adapted for this branch: `DefaultExecutionGraph#registerExecutionStateUpdateListener` does not exist here, so the test wires its listener at graph construction time via `TestingDefaultExecutionGraphBuilder` instead of going through a scheduler. ## Verifying this change The four tests added in #28555 (`DefaultExecutionGraphDeploymentTest.testMetricsVisibleToListenersOn*`) are included, adapted as described above, and pass on this branch. ## Does this pull request potentially affect one of the following parts: Same as #28555: no dependencies, no public API, no serializers, no per-record code paths, no deployment/recovery impact, no S3 connector impact. ## 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]
