title: CoordinatedShutdown timeout on Akka cluster application
body: <p>We've an akka cluster application (sharding some actors). Sometimes, when we deploy and our application should be turned off we see some logs like that:</p>
  
  <blockquote>
    <p>Coordinated shutdown phase [cluster-sharding-shutdown-region] timed
    out after 10000 milliseconds</p>
  </blockquote>
  
  <p>This happens on the first deploy after more than 2 days since last deploy (on mondays for example). We ask the akka node to quit the cluster with the JMX helper and we have the following code too:</p>
  
  <pre><code>actorSystem.registerOnTermination {
    logger.error("Gracefully shutdown of node")
    System.exit(0)
  }
  </code></pre>
  
  <p>So when this error happens, eventually node leaves the cluster (or at least it closes the JMX entry point to manage akka cluster) but process don't finish and the log "Gracefully shutdown of node" doesn't appear. So when this happen we need to shutdown the java process manually (we handle this with supervisor) and redeploy.</p>
  
  <p>I know the timeout can be tunned through config but what are the implications of increasing this timeout? Why sometimes coordinated shutdown throws a timeout? What happens when coordinated shutdown timeout?</p>
  
  <p>Any clue would be appreciated :D</p>
  
  <p>Thank you</p>