[ 
https://issues.apache.org/jira/browse/FLINK-40078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18149794#comment-18149794
 ] 

Martijn Visser commented on FLINK-40078:
----------------------------------------

Two tests on master run into this since VALUES became a FLIP-27 source in 
FLINK-41217. AsyncCorrelateITCase.testRetries failed in four of the 74 master 
runs of the last week, 
ModelFunctionErrorHandlingStrategyTest.testFailoverStrategy once:
https://github.com/apache/flink/actions/runs/44220478228/job/134526331950 
(nightly 2026-11-18, Java 11)
https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=81769&view=logs&j=0c940707-2659-5648-cbe6-a1ad63045f0a
 (push 2026-11-19)
https://github.com/apache/flink/actions/runs/44853489893/job/136692982824 
(nightly 2026-11-21, AdaptiveScheduler)
https://github.com/apache/flink/actions/runs/45097766591/job/137444501395 
(nightly 2026-11-23, Java 21)
https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=81850&view=logs&j=2e8cb2f7-b2d3-5c62-9c05-cd756d33a819
 (push 2026-11-20, ModelFunctionErrorHandlingStrategyTest)

{code}
[ERROR] 
org.apache.flink.table.planner.runtime.stream.table.AsyncCorrelateITCase.testRetries
 -- Time elapsed: 0.499 s <<< FAILURE!
Expecting a root cause with message:
  "Error 9"
but message was:
  "Task is not running, but in state FAILED".
...
Caused by: org.apache.flink.util.FlinkException: An OperatorEvent from an 
OperatorCoordinator to a task was lost. Triggering task failover to ensure 
consistency. Event: '[NoMoreSplitEvent]', targetTask: Source: Values[3985] -> 
Calc[3986] -> AsyncCorrelate[3987] -> Calc[3988] -> ConstraintEnforcer[3989] -> 
Sink: Collect table sink (1/1) - execution #0
Caused by: 
org.apache.flink.runtime.operators.coordination.TaskNotRunningException: Task 
is not running, but in state FAILED
{code}

The first failure is from 2026-10-30, the day after FLINK-41217 was merged. 
release-2.4 doesn't have FLINK-41217, still runs VALUES as the legacy source 
and hasn't failed this way.

> Lost non-loss-tolerant OperatorEvent to an already-failing task triggers a 
> failover that masks the original failure cause
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-40078
>                 URL: https://issues.apache.org/jira/browse/FLINK-40078
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Coordination
>    Affects Versions: 2.5.0
>            Reporter: Martijn Visser
>            Priority: Critical
>              Labels: test-stability
>
> When an OperatorCoordinator sends an event to a subtask that has just failed 
> for an application reason, the delivery fails with 
> {{TaskNotRunningException}} ({{Task.deliverOperatorEvent}}). Because the 
> event is not loss-tolerant, {{SubtaskGatewayImpl.sendEvent}} escalates this 
> into
> {code}
> org.apache.flink.util.FlinkException: An OperatorEvent from an 
> OperatorCoordinator to a task was lost. Triggering task failover to ensure 
> consistency. Event: '[NoMoreSplitEvent]', ...
> {code}
> and triggers a task failover. Under {{NoRestartBackoffTimeStrategy}} that 
> lost-event failover can win the race to the scheduler and become the job's 
> reported terminal failure cause, completely replacing the original 
> application error in the cause chain (the coordinator is co-located with the 
> JobMaster, so its failure path can reach the scheduler faster than the failed 
> task's own failure RPC).
> The consequence is that a user debugging a failed job sees "An OperatorEvent 
> ... was lost. Triggering task failover to ensure consistency" instead of 
> their actual error. This is general: any coordinator event in flight at the 
> moment a task fails for an application reason can mask that failure. It was 
> observed concretely in FLINK-40077, where a {{NoMoreSplitsEvent}} in flight 
> to a task that intentionally failed on the NOT NULL enforcer replaced the 
> enforcer error as the reported cause (there it was worked around in the test 
> scaffolding; this ticket is about the runtime behavior itself).
> The escalation mechanism already has an escape hatch: on 
> {{TaskNotRunningException}}, {{SubtaskGatewayImpl}} returns without failover 
> when {{evt.isLossTolerant()}} is true. {{NoMoreSplitsEvent}} is currently not 
> marked loss-tolerant.
> Possible directions (needs input from runtime/coordination owners, as this 
> touches checkpoint/failover consistency semantics):
> * Mark {{NoMoreSplitsEvent}} loss-tolerant, since a task that is FAILED or 
> FINISHED has no further use for it.
> * More generally, suppress the redundant lost-event failover when the target 
> task is already failing/failed for another reason, so the original cause is 
> preserved.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to