[
https://issues.apache.org/jira/browse/FLINK-41608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18150244#comment-18150244
]
Purushottam Sinha commented on FLINK-41608:
-------------------------------------------
Root cause found by repeating the failing case on GitHub runners (20 jobs x 25
runs, Flink 2.2.0): 14 of 500 runs failed, all with this JobManager exception:
{noformat}
FlinkException: An OperatorEvent from an OperatorCoordinator to a task was
lost. Triggering task failover to ensure consistency. Event: 'BacklogEvent
(backlog='false')', targetTask: ... BatchPrePartition (3/4)
Caused by: TaskNotRunningException: Task is not running, but in state FINISHED
{noformat}
* Since FLINK-36811 (cdc-3.3.0), MySqlSnapshotSplitAssigner#onFinishedSplits
calls setIsProcessingBacklog(false) once all snapshot splits are finished,
which sends IsProcessingBacklogEvent to every reader.
* With scan.startup.mode: snapshot the readers finish with the snapshot. In all
14 failures the target was the reader that finished its split first: its task
had finished 20-50 ms before the event arrived, and the JobManager had not
processed its FINISHED state yet.
* IsProcessingBacklogEvent is not loss tolerant, so Flink fails the task, and
the test cluster runs with restarts off, so the job fails. The "execution
attempt ... was not found" in the TaskManager log is the JobManager rejecting
that task's late FINISHED report.
This is not specific to the test, so it is filed as FLINK-41644: any MySQL
source with scan.startup.mode: snapshot and parallelism above 1 can fail, or
fail over with restarts on, at the end of the snapshot.
* https://github.com/apache/flink-cdc/pull/4634 (FLINK-41644): a snapshot-only
MySQL source no longer reports backlog; with it, 0 of 500 runs failed.
* https://github.com/apache/flink-cdc/pull/4631: the e2e waits stop once the
job has ended and print the failure cause.
> [tests] UdfE2eITCase (java, batch) fails intermittently: the job ends seconds
> after it starts and the test times out waiting for its output
> -------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: FLINK-41608
> URL: https://issues.apache.org/jira/browse/FLINK-41608
> Project: Flink
> Issue Type: Bug
> Components: Flink CDC
> Affects Versions: cdc-3.8.0
> Reporter: Purushottam Sinha
> Priority: Major
> Labels: pull-request-available, test-stability
>
> h3. Problem
> {{UdfE2eITCase}} ({{flink-cdc-pipeline-e2e-tests}}, stage1) fails
> intermittently in its first variant (language: java, batchMode: true), in
> both {{testFlinkCompatibleScalarFunctions}} and {{testUserDefinedFunctions}},
> on Flink 1.20.3 and 2.2.0:
> {noformat}
> java.util.concurrent.TimeoutException:
> failed to get specific event:
> CreateTableEvent{tableId=transform_test_1vk5wus.TABLEALPHA, ...} from stdout:
> Starting Task Manager ...
> at
> PipelineTestEnvironment.waitUntilSpecificEvent(PipelineTestEnvironment.java:632)
> {noformat}
> Between 2026-09-21 and 2026-11-19 it failed 9 times on apache/flink-cdc, 5 of
> them on master:
> ||Date||Build||Flink||Test||
> |2026-09-21|[master
> push|https://github.com/apache/flink-cdc/actions/runs/35582084703]|2.2.0|testFlinkCompatibleScalarFunctions[1]|
> |2026-09-22|[PR,
> FLINK-39410|https://github.com/apache/flink-cdc/actions/runs/35709139302]|2.2.0|testFlinkCompatibleScalarFunctions[1]|
> |2026-09-22|[PR,
> FLINK-40552|https://github.com/apache/flink-cdc/actions/runs/35713792031]|2.2.0|testFlinkCompatibleScalarFunctions[1]|
> |2026-09-29|[master
> push|https://github.com/apache/flink-cdc/actions/runs/36509888510]|1.20.3|testUserDefinedFunctions[1]|
> |2026-10-20|[master
> nightly|https://github.com/apache/flink-cdc/actions/runs/39351812063]|2.2.0|testFlinkCompatibleScalarFunctions[1]|
> |2026-10-21|[master
> push|https://github.com/apache/flink-cdc/actions/runs/39577186792]|2.2.0|testUserDefinedFunctions[1]|
> |2026-10-26|[master
> nightly|https://github.com/apache/flink-cdc/actions/runs/40253175676]|2.2.0|testFlinkCompatibleScalarFunctions[1]|
> |2026-11-11|[PR,
> FLINK-41313|https://github.com/apache/flink-cdc/actions/runs/42974467738]|2.2.0|testFlinkCompatibleScalarFunctions[1]|
> |2026-11-19|[PR,
> FLINK-41570|https://github.com/apache/flink-cdc/actions/runs/44588678068]|2.2.0|testFlinkCompatibleScalarFunctions[1]|
> h3. What the logs show
> The test output holds only the TaskManager log. From [the 2026-11-19
> failure|https://github.com/apache/flink-cdc/actions/runs/44588678068/job/136122109366]:
> * 06:40:30.28: the batch job's 4 source subtasks ({{Source: Flink CDC Event
> Source: mysql -> ... -> BatchPrePartition}}) start.
> * 06:40:31.27: subtasks 2/4 and 4/4 get no split and finish.
> * Subtasks 1/4 and 3/4 read the snapshot splits of TABLEBETA and TABLEALPHA
> (4 rows each) and finish at 06:40:33.63.
> * The JobManager rejects the FINISHED report of subtask 1/4, and the
> TaskManager releases the job at 06:40:33.89:
> {noformat}
> org.apache.flink.runtime.jobmaster.ExecutionGraphException: The execution
> attempt d10ba58f3a855405535af6d6d7caf886_cbc357ccb763df2852fee8c4fc7d55f2_0_0
> was not found.
> {noformat}
> * Nothing reaches the values sink. The test keeps polling the TaskManager
> output for {{EVENT_WAITING_TIMEOUT}} (3 minutes) and fails with the timeout
> above.
> All 9 failures show the same thing: all 4 source subtasks reach FINISHED, and
> the JobManager answers one of them with "execution attempt ... was not
> found". The job has already ended on the JobManager, and why is not in the
> test output: {{PipelineTestEnvironment#waitUntilSpecificEvent}} does not
> check the job's status, and its timeout message prints only the TaskManager
> output, although the JobManager log is captured in {{jobManagerConsumer}}.
> h3. Proposed fix
> # In {{waitUntilSpecificEvent}}, check the job's status on each poll and fail
> at once if the job is FAILED or CANCELED, with the job's root exception; on a
> timeout, add the JobManager log to the message. This also makes other tests
> that fail with this timeout diagnosable.
> # With the JobManager's exception from the next failure, fix the cause.
> h3. Related
> * FLINK-37641: the same timeout in {{SchemaEvolveE2eITCase}} (open).
> * FLINK-38540: an earlier {{UdfE2eITCase}} failure with a different cause
> (concurrent modification while compiling expressions), fixed in cdc-3.6.0.
> * In the same period,
> {{ValuesE2eITCase.testValuesSingleSplitSingleTable(WithDefaultValue)}} failed
> 7 times and {{MysqlE2eITCase.testSyncWholeDatabaseInBatchMode}} 3 times with
> the same timeout; whether they have the same cause was not checked.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)