From 4d65f5603899d8389aadd5b74d4783ed932e577e Mon Sep 17 00:00:00 2001 From: Ashwin Giridharan Date: Mon, 15 Jun 2020 22:02:33 -0700 Subject: [PATCH] Added comments on the garbage cleanup logic - 2 --- .../java/software/amazon/kinesis/lifecycle/ShutdownTask.java | 1 + 1 file changed, 1 insertion(+) diff --git a/amazon-kinesis-client/src/main/java/software/amazon/kinesis/lifecycle/ShutdownTask.java b/amazon-kinesis-client/src/main/java/software/amazon/kinesis/lifecycle/ShutdownTask.java index dd98ca87..9743704d 100644 --- a/amazon-kinesis-client/src/main/java/software/amazon/kinesis/lifecycle/ShutdownTask.java +++ b/amazon-kinesis-client/src/main/java/software/amazon/kinesis/lifecycle/ShutdownTask.java @@ -146,6 +146,7 @@ public class ShutdownTask implements ConsumerTask { // in the case of RNF Exception. attemptShardEndCheckpointing(scope, startTime); } finally { + // Attempt to garbage collect if this shard is no longer associated with the stream. // If we don't want to cleanup the garbage shard without successful shard end // checkpointing, remove the try finally construct and only execute the methods. attemptGarbageCollectionOfLeaseAndEnqueueOnFailure(leasePendingDeletion, currentShardLease);