From 6fb204d507cde422f95fbc219d014d397a4863fb Mon Sep 17 00:00:00 2001 From: "Pfifer, Justin" Date: Mon, 24 Oct 2016 08:11:27 -0700 Subject: [PATCH] Additional Comments about Worker Shutdown Added some additional comments clarifying the shutdown check miss. --- .../clientlibrary/lib/worker/ShutdownFuture.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/amazonaws/services/kinesis/clientlibrary/lib/worker/ShutdownFuture.java b/src/main/java/com/amazonaws/services/kinesis/clientlibrary/lib/worker/ShutdownFuture.java index 218bbefb..f531749a 100644 --- a/src/main/java/com/amazonaws/services/kinesis/clientlibrary/lib/worker/ShutdownFuture.java +++ b/src/main/java/com/amazonaws/services/kinesis/clientlibrary/lib/worker/ShutdownFuture.java @@ -105,10 +105,19 @@ class ShutdownFuture implements Future { } } + /** + * This checks to see if the worker has already hit it's shutdown target, while there is outstanding record + * processors. This maybe a little racy due to when the value of outstanding is retrieved. In general though the + * latch should be decremented before the shutdown completion. + * + * @param outstanding + * the number of record processor still awaiting shutdown. + * @return the number of record processors awaiting shutdown, or 0 if the worker believes it's shutdown already. + */ private long checkWorkerShutdownMiss(long outstanding) { if (isWorkerShutdownComplete()) { if (outstanding != 0) { - log.warn("Shutdown completed, but shutdownCompleteLatch still had outstanding " + outstanding + log.info("Shutdown completed, but shutdownCompleteLatch still had outstanding " + outstanding + " with a current value of " + shutdownCompleteLatch.getCount() + ". shutdownComplete: " + worker.isShutdownComplete() + " -- Consumer Map: " + worker.getShardInfoShardConsumerMap().size());