Skip to content

Conversation

@Efrat19
Copy link
Contributor

@Efrat19 Efrat19 commented Jan 1, 2026

What is the purpose of the change

Ensure the RemoteInputChannel (or remote components) is closed before ChannelStatePersister and ChannelStateWriteRequestExecutorImpl.
Dueing TaskManager shutdown sequence, ChannelStateWriteRequestExecutorImpl is being closed prematurely while RemoteInputChannel is still active. If a new buffer arrives, the active RemoteInputChannel attempts to use the already-closed executor, resulting in the failure.

Brief change log

Bubble ChannelStateWriter up from the StreamTask to Task, and close it after the InputGates.

Verifying this change

This change added tests and can be verified as follows:

  • The ChannelStateWriter is closed at the Task level, in both completion and failure.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 1, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@Efrat19 Efrat19 force-pushed the FLINK-38804-3.3 branch 2 times, most recently from 2333f28 to 0469fec Compare January 5, 2026 06:14
@Efrat19 Efrat19 changed the title [FLINK-38804][runtime] draft fix 3.3 [FLINK-38804][runtime] Ensure channelStateWriter is closed after the inputGates Jan 5, 2026
@Efrat19
Copy link
Contributor Author

Efrat19 commented Jan 5, 2026

@flinkbot run azure

@Efrat19 Efrat19 marked this pull request as ready for review January 7, 2026 07:25
@github-actions github-actions bot added the community-reviewed PR has been reviewed by the community. label Jan 8, 2026
@1996fanrui 1996fanrui self-assigned this Jan 11, 2026
Copy link
Member

@1996fanrui 1996fanrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Efrat19 for the fix!

Overall LGTM, I only left some minor comments, please take a look when you are available, thanks

@Efrat19 Efrat19 marked this pull request as draft January 12, 2026 10:39
@Efrat19
Copy link
Contributor Author

Efrat19 commented Jan 12, 2026

@flinkbot run azure

…inputGates

[FLINK-38804][runtime] Ensure channelStateWriter is closed after the inputGates
Copy link
Member

@1996fanrui 1996fanrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming CI is green

@Efrat19 Efrat19 marked this pull request as ready for review January 12, 2026 18:12
@1996fanrui 1996fanrui merged commit 40dca97 into apache:master Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants