amazon-kinesis-client
amazon-kinesis-client copied to clipboard
Fix null pointer exception that happens in shutdown before lease have got
Issue #, if available: https://github.com/awslabs/amazon-kinesis-client/issues/900 https://github.com/awslabs/amazon-kinesis-client/issues/745
Description of changes: This change adds a null check to avoid exceptions, in conditions when the worker didn't get the lease. Without this change, the shutdown process interrupts and workers are continuing to operate.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
@pfifer @sahilpalvia is #900 #745 is a known issue? Any ideas what else we could do besides completing this client fix? Any extra insight would be greatly appreciated!
In summary, coordinator can't stop lease taker software.amazon.kinesis.leases.dynamodb.DynamoDBLeaseCoordinator.stopLeaseTaker(DynamoDBLeaseCoordinator.java:332)
, so during new deploys we sometimes have a lease unbalance between our instances for a new deploy. We thought the coordinator would re-balance, what also doesn't do. On our end, seems we can also enable the debugging mode mentioned here, to have more insights on the re-balance. The NPE should be handled.