Merge pull request #19912 from 412b/fix-19824-unhandled-failure-in-rarp
#19824 Unhandled akka.actor.Status.Failure in RemoteActorRefProvider in state WaitTransportShutdown
This commit is contained in:
commit
b52c498638
3 changed files with 13 additions and 5 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
package akka.remote
|
||||
|
||||
import akka.Done
|
||||
import akka.actor._
|
||||
import akka.dispatch.sysmsg._
|
||||
import akka.event.{ Logging, LoggingAdapter, EventStream }
|
||||
|
|
@ -59,10 +60,15 @@ private[akka] object RemoteActorRefProvider {
|
|||
}
|
||||
|
||||
when(WaitTransportShutdown) {
|
||||
case Event((), _) ⇒
|
||||
case Event(Done, _) ⇒
|
||||
log.info("Remoting shut down.")
|
||||
systemGuardian ! TerminationHookDone
|
||||
stop()
|
||||
|
||||
case Event(Status.Failure(ex), _) ⇒
|
||||
log.error(ex, "Remoting shut down with error")
|
||||
systemGuardian ! TerminationHookDone
|
||||
stop()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
package akka.remote
|
||||
|
||||
import akka.AkkaException
|
||||
import akka.Done
|
||||
import akka.actor._
|
||||
import akka.event.{ LoggingAdapter }
|
||||
import scala.collection.immutable
|
||||
|
|
@ -39,7 +40,7 @@ private[akka] abstract class RemoteTransport(val system: ExtendedActorSystem, va
|
|||
/**
|
||||
* Shuts down the remoting
|
||||
*/
|
||||
def shutdown(): Future[Unit]
|
||||
def shutdown(): Future[Done]
|
||||
|
||||
/**
|
||||
* Address to be used in RootActorPath of refs generated for this transport.
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
*/
|
||||
package akka.remote
|
||||
|
||||
import akka.Done
|
||||
import akka.actor.SupervisorStrategy._
|
||||
import akka.actor._
|
||||
import akka.event.{ Logging, LoggingAdapter }
|
||||
|
|
@ -135,7 +136,7 @@ private[remote] class Remoting(_system: ExtendedActorSystem, _provider: RemoteAc
|
|||
private def notifyError(msg: String, cause: Throwable): Unit =
|
||||
eventPublisher.notifyListeners(RemotingErrorEvent(new RemoteTransportException(msg, cause)))
|
||||
|
||||
override def shutdown(): Future[Unit] = {
|
||||
override def shutdown(): Future[Done] = {
|
||||
endpointManager match {
|
||||
case Some(manager) ⇒
|
||||
implicit val timeout = ShutdownTimeout
|
||||
|
|
@ -156,10 +157,10 @@ private[remote] class Remoting(_system: ExtendedActorSystem, _provider: RemoteAc
|
|||
case Failure(e) ⇒
|
||||
notifyError("Failure during shutdown of remoting.", e)
|
||||
finalize()
|
||||
} map { _ ⇒ () } // RARP needs only type Unit, not a boolean
|
||||
} map { _ ⇒ Done } // RARP needs only akka.Done, not a boolean
|
||||
case None ⇒
|
||||
log.warning("Remoting is not running. Ignoring shutdown attempt.")
|
||||
Future successful (())
|
||||
Future successful Done
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue