Skip to content
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

Add CoordinatedShutdown task (or document how) automatically in AkkaManagement.stop() #591

Open
helena opened this issue Aug 30, 2019 · 5 comments

Comments

@helena
Copy link
Member

helena commented Aug 30, 2019

For example, something like

val management = AkkaManagement(system) 

// call internalStart() where appropriate 
private def internalStart(): Future[Done] = { 
  import system.dispatcher 
  management.start().map { _ => 
    CoordinatedShutdown(system).addTask(CoordinatedShutdown.PhaseBeforeServiceUnbind, "stop-akka-http-management") { () => management.stop() } 
    Done 
  } 
} 

And clarify necessity of AkkaManagement.stop() in docs or once integrated, remove the section or explain it's done automatically.
@ignasi35
Copy link
Member

ignasi35 commented Sep 4, 2019

The general recommendation wrt lifecycle management was for libraries (like Akka Management) to document recommended ways to handle the shutdown without actually doing the actual task registration.

This leaves users of the library or framework integrators the options to handle the lifecycle whichever way works best for them.

@helena
Copy link
Member Author

helena commented Sep 4, 2019

It could be configurable - enable/disable with off by default.

@ignasi35
Copy link
Member

ignasi35 commented Sep 4, 2019

It could be configurable - enable/disable with off by default.

I think this is counterintuitive. IMHO, having a coherent approach to lifecycle management in all libraries of the ecosystem is very helpful. Then, each library should consider the shutdown a first-level topic on their ref docs and start the page with a snippet registering the necessary tasks to fully shutdown each module on that library.

The main problem I have, as a Lagom maintainer, is that my usage of akka-management is specific to Lagom (and other users will have specific use cases). I also may have custom phases on the shutdown DAG of tasks. Then, if I want to use akka-management I have to disable some default behavior to, then, code it back with my specific needs.

@chbatey
Copy link
Member

chbatey commented Nov 12, 2019

We should at the very least document that it is a good idea.

@chbatey chbatey changed the title Add CoordinatedShutdown task automatically in AkkaManagement.stop() Add CoordinatedShutdown task (or document how) automatically in AkkaManagement.stop() Nov 12, 2019
YikSanChan added a commit to YikSanChan/akka-management that referenced this issue Apr 2, 2020
YikSanChan added a commit to YikSanChan/akka-management that referenced this issue Apr 2, 2020
@ennru
Copy link
Member

ennru commented May 8, 2020

#650 added a link to how Lagom does it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants