Skip to content

Conversation

@beliefer
Copy link
Contributor

@beliefer beliefer commented Apr 16, 2025

What is the purpose of the change

This PR aims to avoid invalid thread for state reader.
Sometimes, the inputGates is an empty array. We can avoid creating thread for it.

Brief change log

Avoid invalid thread for state reader.

Verifying this change

This change is already covered by existing tests, such as (StreamTaskTest).

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)

@flinkbot
Copy link
Collaborator

flinkbot commented Apr 16, 2025

CI report:

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

"Unable to read channel state", e);
}
});
if (inputGates.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: prior to the fix there was an Exception now we issue the return. I think there should be a test for this, as there is a change in behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are many test cases trigger this case, such as testFailingAsyncCheckpointRunnable, testStateBackendLoadingAndClosing, testHandleAsyncExceptionDuringRestoring, testProcessWithUnAvailableOutput, testProcessWithRaceInDataAvailability, testEmptySubtaskStateLeadsToStatelessAcknowledgment, testStateBackendClosingOnFailure, testExecuteMailboxActionsAfterLeavingInputProcessorMailboxLoop, testUncaughtExceptionInAsynchronousCheckpointingOperation, testDecliningCheckpointStreamOperator, testProcessWithUnAvailableInput, testAsyncCheckpointingConcurrentCloseAfterAcknowledge, testAsyncCheckpointingConcurrentCloseBeforeAcknowledge, testThreadInvariants, testTaskAvoidHangingAfterSnapshotStateThrownException, testMailboxMetricsScheduling, testRestorePerformedOnlyOnce, testRestorePerformedFromInvoke, testEarlyCanceling, testProcessWithAvailableOutput, testQuiesceOfMailboxRightBeforeSubmittingActionViaTimerService in StreamTaskTest

@beliefer
Copy link
Contributor Author

@github-actions github-actions bot added community-reviewed PR has been reviewed by the community. and removed community-reviewed PR has been reviewed by the community. labels Jun 30, 2025
@github-actions github-actions bot added community-reviewed PR has been reviewed by the community. and removed community-reviewed PR has been reviewed by the community. labels Aug 30, 2025
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.

3 participants