-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Use Akka's Reason when shutting down and disable Akka JVM hooks globally #8087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Akka's Reason when shutting down and disable Akka JVM hooks globally #8087
Conversation
|
Hmm, build fails on The fix for that issue is on #8088 |
|
Thanks @marcospereira! I've updated the PR description: there's nothing left for this PR. We can relaunch the build and merge if it passes. |
|
Meh, it now failed on mima. I'll rebase on |
35400a5 to
3e66647
Compare
|
|
||
| import javax.inject.{ Inject, Provider, Singleton } | ||
|
|
||
| import akka.actor.CoordinatedShutdown.ClusterDowningReason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this import needed?
| } finally { | ||
| CoordinatedShutdown(actorSystem).run() | ||
| // On testing, use any reason | ||
| CoordinatedShutdown(actorSystem).run(JvmExitReason) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably doesn't matter for now but since we're not actually killing the jvm it would make more sense to use ApplicationShutdownReason. Not sure if there is or could be special handling for the jvm exit case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it just invoke the returned stopHook?
…lly (playframework#8087) * Use Akka's Reason when shutting down and disable Artery * Organize imports of Akka.scala * Run the stopHook after ActorSystemProviderSpec
Akka
2.5.8introduced theReasonargument on theCoordinatedShutdownAPI so CS users can distinguish the actual trigger of the shutdown process.Akka
2.5.8also introduced thejvm-shutdown-hookssetting to make sure there's a single responsible for registering JVM shutdown hooks. This setting should be disabled on Play's2.6.xbranch.Play users that embed an Akka Cluster node inside the play application and use Artery will have to register the Artery shutdown manually. This need documentation.Artery is shutdown when the actor system is terminated which play will take care of.