-
Notifications
You must be signed in to change notification settings - Fork 467
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
Correcting the behavior of gracefulShutdown #1302
Merged
vincentvilo-aws
merged 8 commits into
awslabs:master
from
vincentvilo-aws:new-graceful-shutdown
Apr 3, 2024
Merged
Correcting the behavior of gracefulShutdown #1302
vincentvilo-aws
merged 8 commits into
awslabs:master
from
vincentvilo-aws:new-graceful-shutdown
Apr 3, 2024
Conversation
This file contains 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
chenylee-aws
reviewed
Apr 2, 2024
amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/Scheduler.java
Outdated
Show resolved
Hide resolved
amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/Scheduler.java
Outdated
Show resolved
Hide resolved
vincentvilo-aws
commented
Apr 2, 2024
...is-client/src/main/java/software/amazon/kinesis/coordinator/GracefulShutdownCoordinator.java
Outdated
Show resolved
Hide resolved
chenylee-aws
reviewed
Apr 3, 2024
...is-client/src/main/java/software/amazon/kinesis/coordinator/GracefulShutdownCoordinator.java
Outdated
Show resolved
Hide resolved
...is-client/src/main/java/software/amazon/kinesis/coordinator/GracefulShutdownCoordinator.java
Outdated
Show resolved
Hide resolved
chenylee-aws
approved these changes
Apr 3, 2024
This was referenced Apr 3, 2024
This was referenced Apr 28, 2024
akidambisrinivasan
pushed a commit
to akidambisrinivasan/amazon-kinesis-client
that referenced
this pull request
Apr 29, 2024
* modify ShutdownTask to call shutdownComplete for graceful shutdown * add test to verify ShutdownTask succeeds regardless of shutdownNotification * change access level for finalShutdownLatch to NONE * remove unused variable in GracefulShutdownCoordinator * make comment more concise * move waitForFinalShutdown method into GracefulShutdownCoordinator class * cleanup call method of GracefulShutdownCoordinator * modify waitForFinalShutdown to throw InterruptedException
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.
Issue #, if available: #616
Description of changes: This PR corrects the behavior of Scheduler's gracefulShutdown.
Originally, calling
Scheduler.startGracefulShutdown()
would return false because theCountDownLatch
used to track the shutdowns of the record processors was never decremented. To address this issue, theCountDownLatch
is decremented within theConsumerTask
of theShuttingDownState
(see ShutdownTask.java). TheShutdownCompleteState
is now used as a terminal state and contains no associatedConsumerTask
.Also, another
CountDownLatch
was introduced to the Scheduler to ensure that itsfinalShutdown()
method is returned before thestartGracefulShutdown()
returns.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.