[
https://issues.apache.org/jira/browse/FLINK-40003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18093202#comment-18093202
]
Matthias Pohl edited comment on FLINK-40003 at 7/3/26 7:19 PM:
---------------------------------------------------------------
* master:
[c0f774fdcef|https://github.com/apache/flink/commit/c0f774fdcefab05cf25c986effaad78fa5ecff2a]
* 2.3:
[bda6d208c|https://github.com/apache/flink/commit/bda6d208c571641f75391f13b3089859174b426c]
* 2.2:
[7244dc10e|https://github.com/apache/flink/commit/7244dc10ea48b4dbaa56f8f6e4ceeb0bcd5a040f]
* 1.20:
[069ddfe51|https://github.com/apache/flink/commit/069ddfe5179ec3e79632e21931ca80e775673f60]
was (Author: mapohl):
* master:
[c0f774fdcef|https://github.com/apache/flink/commit/c0f774fdcefab05cf25c986effaad78fa5ecff2a]
* 2.3: tba
* 2.2: tba
* 1.20: tba
> IOMetrics not visible to ExecutionStateUpdateListeners during FINISHED/FAILED
> transitions
> -----------------------------------------------------------------------------------------
>
> Key: FLINK-40003
> URL: https://issues.apache.org/jira/browse/FLINK-40003
> Project: Flink
> Issue Type: Bug
> Components: Runtime / Coordination
> Affects Versions: 2.3.0, 2.2.1, 1.20.5, 2.4.0
> Reporter: Chris Johnson
> Assignee: Chris Johnson
> Priority: Major
> Labels: pull-request-available
>
> {{ExecutionStateUpdateListeners}} registered on the ExecutionGraph are
> notified inline during {{{}Execution.transitionState(){}}}. When an execution
> reaches a terminal state, a listener may want to read the final IOMetrics
> via {{Execution.getIOMetrics()}} – for example, to emit observability events
> that include bytes/records in/out.
> In {{markFinished()}} and {{{}processFail(){}}},
> {{updateAccumulatorsAndMetrics()}} is called *after*
> {{{}transitionState(){}}}, so listeners always see null from
> {{{}getIOMetrics(){}}}during FINISHED and FAILED notifications.
> {{completeCancelling()}} already has the correct ordering – it calls
> {{updateAccumulatorsAndMetrics()}} *before* {{{}transitionState(){}}}.
> The call chain:
> {{ Execution.transitionState()}}
> {{ -> ExecutionVertex.notifyStateTransition()}}
> {{ -> DefaultExecutionGraph.notifyExecutionChange()}}
> {{ -> ExecutionStateUpdateListener.onStateUpdate()}}
> {{ -> execution.getIOMetrics()}} // null – not yet stored
> The fix is to move {{updateAccumulatorsAndMetrics()}} before
> {{transitionState()}} in {{markFinished()}} and {{{}processFail(){}}},
> matching the ordering already used in {{{}completeCancelling(){}}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)