[FLINK-40077][table-planner] Fix lost NoMoreSplitsEvent masking failure cause in CommonExecSinkITCase#28646
Open
MartijnVisser wants to merge 1 commit into
Conversation
…re cause in CommonExecSinkITCase The Source V2 test source in CommonExecSinkITCase emits all rows on the first pollNext call, before the coordinator's NoMoreSplitsEvent has been delivered. When the NOT NULL enforcer then fails the chained Source -> ConstraintEnforcer -> Writer task, the still-in-flight NoMoreSplitsEvent reaches an already-FAILED task and is reported as a lost OperatorEvent. That failover exception wins as the job's terminal cause under NoRestartBackoffTimeStrategy and masks the expected enforcer error, so testNullEnforcer flakily fails its cause assertion. Gate record emission on the NoMoreSplitsEvent so that both coordinator events (the split assignment and the no-more-splits signal) are always delivered before any record is emitted, and thus before the enforcer can fail the task. This leaves no coordinator event in flight at the moment of failure and makes the intended enforcer error the only failure cause. This extends the gating introduced in FLINK-40011, which deferred only END_OF_INPUT, to record emission as well. Generated-by: Claude Code (Opus 4.8)
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
CommonExecSinkITCase.testNullEnforceris flaky on CI (observed on the AdaptiveScheduler nightly leg, Azure build 76751). The test asserts that the job failure cause chain contains the NOT NULL enforcer message, but intermittently the reported terminal cause is insteadFlinkException: An OperatorEvent ... was lost ... Event: '[NoMoreSplitEvent]'.Root cause: the Source V2 test source emits all rows on the first
pollNext, before the coordinator'sNoMoreSplitsEventis delivered. The NOT NULL enforcer then fails the chainedSource -> ConstraintEnforcer -> Writertask; the still-in-flightNoMoreSplitsEventreaches an already-FAILED task and, since it is not loss-tolerant, escalates to a lost-OperatorEvent failover. UnderNoRestartBackoffTimeStrategythat failover wins as the reported cause and masks the enforcer error. This race is distinct from FLINK-40011 (which addressed the reader reaching FINISHED before the event arrived); it occurs on the FAILED-task path, which gatingEND_OF_INPUTalone cannot cover.The underlying runtime behavior (a lost, non-loss-tolerant coordinator event to an already-failing task superseding the real application failure cause) is a pre-existing general issue tracked separately as FLINK-40078; this PR only removes the race from the test scaffolding.
Brief change log
pollNextonnoMoreSplits, so both coordinator events are delivered before any record is emitted (and thus before the enforcer can fail the task), leaving no coordinator event in flight at failure time. This extends thenoMoreSplitsgating added in FLINK-40011 from completion to emission.Verifying this change
This change is a test-stability fix, covered by the existing
CommonExecSinkITCasetests.CommonExecSinkITCase#testNullEnforcer30 times under-Penable-adaptive-scheduler(the failing profile): all green.testStreamRecordTimestampInserter*,testUnifiedSinksAreUsableWithDataStreamSinkProvider,testCharLengthEnforcer,testBinaryLengthEnforcer) still pass, since the enumerator always signals no-more-splits and the rows are still emitted.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8)