[FLINK-40520][checkpointing] Release spilled channel state on recovery abort between fetch and drain - #29065
Open
1996fanrui wants to merge 1 commit into
Open
[FLINK-40520][checkpointing] Release spilled channel state on recovery abort between fetch and drain#290651996fanrui wants to merge 1 commit into
1996fanrui wants to merge 1 commit into
Conversation
1996fanrui
force-pushed
the
FLINK-40520
branch
from
September 2, 2026 08:41
782c926 to
31cd9d0
Compare
…y abort between fetch and drain
1996fanrui
force-pushed
the
FLINK-40520
branch
from
September 2, 2026 11:57
31cd9d0 to
43cde36
Compare
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
Spilled channel-state files produced during checkpointing during recovery were released only when
drain()ran. Several fetch→drain abort paths never reach
drain(readInputDatathrows after a file was spilled; therequestPartitionsor trigger-install mail is dropped/throws;thenRunAsync(drain)is rejected after thechannelIOExecutorshut down), so the producedFetchedChannelStatewas never closed and its spill filessurvived until TaskManager shutdown — accumulating across recovery-failure loops on a long-lived pooled TM.
This gives the produced state a single owner that force-closes it on any such abort.
Brief change log
FetchedChannelStateon abort: close it in afinallyinSequentialChannelStateReaderImpl.readInputDatafor a fetch-time throw, and register it with the taskcancelablesfor the fetch→drain cancel/fail window. Idempotent with the happy path.Verifying this change
This change added a test:
SequentialChannelStateReaderImplTestasserts the spill files are deleted whenreadInputDataaborts after spilling at least one file (fails without the fix).Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?