Remove shutdown hook on shutting down (#23866)
When shutting down, we compliment the addition of a shutdown hook during startup with its removal. Doing so further ensures that no class loader is retained when unloading Akka in an OSGi style scenario.
This commit is contained in:
parent
83a97256cc
commit
aa2ab4b6e2
1 changed files with 1 additions and 0 deletions
|
|
@ -865,6 +865,7 @@ private[remote] class ArteryTransport(_system: ExtendedActorSystem, _provider: R
|
||||||
override def shutdown(): Future[Done] = {
|
override def shutdown(): Future[Done] = {
|
||||||
if (hasBeenShutdown.compareAndSet(false, true)) {
|
if (hasBeenShutdown.compareAndSet(false, true)) {
|
||||||
log.debug("Shutting down [{}]", localAddress)
|
log.debug("Shutting down [{}]", localAddress)
|
||||||
|
Runtime.getRuntime.removeShutdownHook(shutdownHook)
|
||||||
val allAssociations = associationRegistry.allAssociations
|
val allAssociations = associationRegistry.allAssociations
|
||||||
val flushing: Future[Done] =
|
val flushing: Future[Done] =
|
||||||
if (allAssociations.isEmpty) Future.successful(Done)
|
if (allAssociations.isEmpty) Future.successful(Done)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue