amazon-kinesis-client
amazon-kinesis-client copied to clipboard
NullPointerException on Scheduler.startGreacefulShutdown
Calling Scheduler.startGracefulShutdown
on a scheduler too fast after the scheduler has been started results in a NullPointerException, and the scheduler is not shut down.
java.lang.NullPointerException
DynamoDBLeaseCoordinator.java: 332 software.amazon.kinesis.leases.dynamodb.DynamoDBLeaseCoordinator/stopLeaseTaker
Scheduler.java: 755 software.amazon.kinesis.coordinator.Scheduler/lambda$createWorkerShutdownCallable$20
GracefulShutdownCoordinator.java: 152 software.amazon.kinesis.coordinator.GracefulShutdownCoordinator$GracefulShutdownCallable/call
GracefulShutdownCoordinator.java: 38 software.amazon.kinesis.coordinator.GracefulShutdownCoordinator$GracefulShutdownCallable/call
FutureTask.java: 264 java.util.concurrent.FutureTask/run
Thread.java: 834 java.lang.Thread/run
I have this exact issue too:
2020-10-22T22:50:53.8824996Z Exception while executing graceful shutdown: java.lang.NullPointerException
2020-10-22T22:50:53.8826886Z Oct 22, 2020 10:50:35 PM software.amazon.kinesis.coordinator.GracefulShutdownCoordinator$GracefulShutdownCallable call
2020-10-22T22:50:53.8828597Z WARNING: Caught exception while requesting initial worker shutdown.
2020-10-22T22:50:53.8829298Z java.lang.NullPointerException
2020-10-22T22:50:53.8831484Z at software.amazon.kinesis.leases.dynamodb.DynamoDBLeaseCoordinator.stopLeaseTaker(DynamoDBLeaseCoordinator.java:332)
2020-10-22T22:50:53.8834249Z at software.amazon.kinesis.coordinator.Scheduler.lambda$createWorkerShutdownCallable$20(Scheduler.java:755)
2020-10-22T22:50:53.8836790Z at software.amazon.kinesis.coordinator.GracefulShutdownCoordinator$GracefulShutdownCallable.call(GracefulShutdownCoordinator.java:152)
2020-10-22T22:50:53.8839892Z at software.amazon.kinesis.coordinator.GracefulShutdownCoordinator$GracefulShutdownCallable.call(GracefulShutdownCoordinator.java:38)
2020-10-22T22:50:53.8841928Z at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2020-10-22T22:50:53.8842715Z at java.base/java.lang.Thread.run(Thread.java:832)
@csgero @tom-beatdapp did you get a solution on the coordinator or a workaround for this?
No, I didn't. This wasn't a blocking issue, more of a nuisance.
@Novaes No, I didn't. You might be able to workaround the issue by checking if scheduler.leaseCoordinator != null
or something, when you make a shutdown attempt, but I'm not sure, it's been awhile.
Fixed in KCL 2.x
. We released 2.5.1
yesterday (2023/06/27), so expect this in the next release. Thanks for your incredible patience!