2.6.x CoordinatedShutdown reason


I’m looking at a way to automatically restart Akka Cluster nodes. Currently, we just register a JVM shutdown hook, and exit with a fixed status.
This doesn’t allow differentiating between a ‘normal’ shutdown, and a node getting kicked out of the cluster.

I found a few (old) issues, but most where closed with a reference to Coordinated Shutdown. Looking at the API, it doesn’t pass along the reason, and is more about the shutdown order then the reason for the shutdown.

Do I miss something ? Can anyone shed a light on this ?



If you instead use the build in shutdown hook, it uses the exit code configured for the reason it shut down:

Ah, nice. I didn’t look in the reference.conf. Can this also be done in code ?

It’s only possible to set through configuration (which can be constructed by code though).