awslabs/amazon-kinesis-client

[3.0.0] NullPointerException in leaseCoordinatorThreadPool when calling shutdown

Closed this issue · 1 comments

I have a test that creates a Scheduler (but does not start it via run), asserts some properties and calls Scheduler.shutdown. This triggers a NPE:

java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ScheduledExecutorService.shutdownNow()" because "this.leaseCoordinatorThreadPool" is null
   at software.amazon.kinesis.leases.dynamodb.DynamoDBLeaseCoordinator.stop(DynamoDBLeaseCoordinator.java:386)
   at software.amazon.kinesis.coordinator.Scheduler.shutdown(Scheduler.java:1030)

I think the call to leaseCoordinatorThreadPool.shutdownNow() in line 386 is not needed, because the shutdown of that pool already happens a few lines above

Fix is merged and will be part of next release.