amazon-kinesis-client icon indicating copy to clipboard operation
amazon-kinesis-client copied to clipboard

Fix null pointer exception that happens in shutdown before lease have got

Open AndriiChuzhynov opened this issue 3 years ago • 2 comments

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.

AndriiChuzhynov avatar Jan 12 '22 19:01 AndriiChuzhynov

@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!

Novaes avatar Jan 19 '22 02:01 Novaes

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.

Novaes avatar Jan 19 '22 02:01 Novaes