-
Notifications
You must be signed in to change notification settings - Fork 15.4k
MINOR: prevent cleanup() from being called while Streams is still shutting down #10666
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -170,8 +170,8 @@ public void shouldSurviveWithOneTaskAsStandby() throws Exception { | |
| // Wait for the record to be processed | ||
| assertTrue(instanceLatch.await(15, TimeUnit.SECONDS)); | ||
|
|
||
| streamInstanceOne.close(Duration.ZERO); | ||
| streamInstanceTwo.close(Duration.ZERO); | ||
|
Comment on lines
-173
to
-174
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test failing does give me some small pause on just throwing an IllegalStateException in case of PENDING_SHUTDOWN/ERROR -- do we think many users follow this pattern of calling the non-blocking
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How hard could it be to have I think this a much more flexible pattern that would be good to support if it's running or rebalancing we would still want to throw and
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I already have a unit test in this PR for the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess another alternative is just to have
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think if they call a non blocking close then clean up then later notice the leftovers that is not a great experience and if can prevent it we should. I agree probably not worth a KIP though
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the moment, if user calls a close() with no blocking and then cleanUp, the latter Hence I think the new behavior is not really a regression but really a fix forward. |
||
| streamInstanceOne.close(); | ||
| streamInstanceTwo.close(); | ||
|
|
||
| streamInstanceOne.cleanUp(); | ||
| streamInstanceTwo.cleanUp(); | ||
|
|
||
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.
Ah that's a nice one: we are sure all threads are gone now so there's no need to lock :)