Description of changes: This PR corrects the behavior of Scheduler's gracefulShutdown.
Originally, calling Scheduler.startGracefulShutdown() would return false because the CountDownLatch used to track the shutdowns of the record processors was never decremented. To address this issue, the CountDownLatch is decremented within the ConsumerTask of the ShuttingDownState (see ShutdownTask.java). The ShutdownCompleteState is now used as a terminal state and contains no associated ConsumerTask.
Also, another CountDownLatch was introduced to the Scheduler to ensure that its finalShutdown()method is returned before the startGracefulShutdown() returns.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
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.