awslabs / amazon-kinesis-client

Client library for Amazon Kinesis
Apache License 2.0
644 stars 467 forks source link

Shutdown Not Called on Record Processors when MultiLangDaemon is Terminated #35

Closed eyesoftime closed 7 years ago

eyesoftime commented 9 years ago

When running the daemon (from command-line for example), upon terminating the process (Ctrl+C or SIGTERM) it exits and doesn't call shutdown() on child processes. It doesn't allow child processes to terminate cleanly by checkpointing their state. Is this intentional or something that's just not been implemented (yet)?

gharikum commented 9 years ago

Apologize for this. A few users have reported similar problems. We are working on clean shutdown mechanics for the KCL. But don't have a release date yet.

abonhomme commented 8 years ago

Just curious if there's an ETA on this one yet? thanks!

darkcrawler01 commented 8 years ago

+1

daskruegge commented 8 years ago

+1

findchris commented 8 years ago

@gharikum - Any movement here? I see no new KCL development for about 5 months now.

pfifer commented 7 years ago

Thanks for reporting this. It does appear this affects many customers, and I'll be investigating adding a shutdown hook that should help this. It won't fix cases where the JVM doesn't get a chance to shutdown normally e.g. kill -9.

ewalker11 commented 7 years ago

We could really use this. Any update?

jgrier commented 7 years ago

It looks like this was fixed here, no? https://github.com/awslabs/amazon-kinesis-client/commit/5a8bac23c613a307f22611c2f1a289347e893067

Should this issue be closed?

pfifer commented 7 years ago

Thanks for catching this, I'll close it now.

For posterity: This was fixed in #174 with the addition of graceful shutdown for MultiLang Daemon clients.

Let us know if you run into any problems.

dhruvpanwar95 commented 6 years ago

When i stop application using ctrl+c,shutdown requested method of I shutdown Aware doesn't get called

pfifer commented 6 years ago

This change only affected the multilang daemon clients, and not the general Java KCL. If you're using Java you can install the shutdown hook yourself. I don't want to install it for customers using Java, as it could cause unexpected behavior.

mitaligit commented 2 years ago

Does the shutdownRequested work for Java KCL as well now?

hsingh124 commented 2 months ago

Hey, I am working with the multilang daemon in php. I try to terminate the java process with SIGINT but get a timeout exception whenever the shutdown happens. Can I get some help with this? Here are the logs:

2024-08-12 18:06:09,299 [Thread-1] INFO  s.a.k.multilang.MultiLangDaemon [NONE] - Process terminated, will initiate shutdown. 
2024-08-12 18:06:09,312 [Thread-1] ERROR s.a.k.multilang.MultiLangDaemon [NONE] - Encountered an error during shutdown. 
java.util.concurrent.TimeoutException: null
    at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1892)
    at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2027)
    at software.amazon.kinesis.multilang.MultiLangDaemon.lambda$setupShutdownHook$0(MultiLangDaemon.java:183)
    at java.base/java.lang.Thread.run(Thread.java:829)

Thanks!