awslabs / amazon-kinesis-client

Client library for Amazon Kinesis
Apache License 2.0
635 stars 461 forks source link

fix: does not request shutdown for already shutdown consumer #1276

Closed nao23 closed 2 months ago

nao23 commented 4 months ago

This patch fixes #1251 .

In graceful shutdown phase, two CountDownLatch variables that value is the number of worker lease are used to wait all consumers are shutdown completed.

If the worker has a lease of completed shard, the worker requests shutdown for its consumer but the consumer is already shutdown and cannot decrement latches so two latches never becomes to 0 and always timeout.

This patch modifies worker not to request shutdown for already shutdown consumer and only decrement latch.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

vincentvilo-aws commented 2 months ago

I'll be closing this PR since this was addressed in the original issue. Please see my comment left on #1251.