-
Notifications
You must be signed in to change notification settings - Fork 14.9k
KAFKA-19960: Close pending tasks on shutdown. (#21365) #21421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR fixes a bug when KS doesn't close stores if the shutdown was triggered during rebalance where an active tasks gets converted to a standby one and put into pendingTasksToInit * Added logic to close pending tasks to init. * Made standby task closure similar to the one for active tasks. * Added a separate method for getting standby tasks from task registry. * Added an integration test that reproduces the issue. Reviewers: Matthias J. Sax <matthias@confluent.io> --------- Co-authored-by: Matthias J. Sax <mjsax@apache.org>
|
cherry pick of #21365 |
|
@Nikita-Shupletsov it seems like there are compilation errors: Since tomorrow would be the code freeze for 4.0.2, would you please take a look? |
| // and starting the shutdown directly | ||
| // We don't want to let the rebalance finish before we trigger the shutdown, because we want the stream thread to stop before it gets to moving pending tasks from task registry to state updater. | ||
| streams1.close(new KafkaStreams.CloseOptions().leaveGroup(true)); | ||
| streams2.close(new KafkaStreams.CloseOptions().leaveGroup(true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work as expected (that's why it was change in newer release). It only works for static members.
In 4.0, there is an internal config that we should use instead.
|
@viktorsomogyi, @mjsax |
Cherry-pick of #21365.
This PR fixes a bug when KS doesn't close stores if the shutdown was triggered during rebalance where an active tasks gets converted to a standby one and put into pendingTasksToInit
Conflicts:
streams/src/test/java/org/apache/kafka/streams/processor/internals/TaskManagerTest.java
Additional changes:
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/RebalanceTaskClosureIntegrationTest.java
Reviewers: Matthias J. Sax matthias@confluent.io