Fail all stages on abrupt termination #22652

This commit is contained in:
Johan Andrén 2017-04-28 11:11:50 +02:00 committed by GitHub
parent 7ca40a8518
commit 87b28d0dc5
23 changed files with 307 additions and 72 deletions

View file

@ -17,6 +17,7 @@ import com.typesafe.config.Config
import scala.concurrent.duration._
import akka.japi.function
import akka.stream.impl.fusing.GraphInterpreterShell
import akka.stream.stage.GraphStageLogic
import scala.util.control.NoStackTrace
@ -221,6 +222,15 @@ class MaterializationException(msg: String, cause: Throwable = null) extends Run
final case class AbruptTerminationException(actor: ActorRef)
extends RuntimeException(s"Processor actor [$actor] terminated abruptly") with NoStackTrace
/**
* Signal that the stage was abruptly terminated, usually seen as a call to `postStop` of the `GraphStageLogic` without
* any of the handler callbacks seeing completion or failure from upstream or cancellation from downstream. This can happen when
* the actor running the graph is killed, which happens when the materializer or actor system is terminated.
*/
final class AbruptStageTerminationException(logic: GraphStageLogic)
extends RuntimeException(s"GraphStage [$logic] terminated abruptly, caused by for example materializer or actor system termination.")
with NoStackTrace
object ActorMaterializerSettings {
/**