stream: don't create AbruptTerminationException in happy case (#28686)
Turned up in heavy stream materialization churn benchmark.
This commit is contained in:
parent
3157b0199b
commit
655dfbc67f
1 changed files with 8 additions and 6 deletions
|
|
@ -794,10 +794,12 @@ import scala.util.control.NonFatal
|
|||
newShells.map(shell => shell.toSnapshot.asInstanceOf[UninitializedInterpreter]))
|
||||
}
|
||||
|
||||
override def postStop(): Unit = {
|
||||
val ex = AbruptTerminationException(self)
|
||||
activeInterpreters.foreach(_.tryAbort(ex))
|
||||
activeInterpreters = Set.empty[GraphInterpreterShell]
|
||||
newShells.foreach(s => if (tryInit(s)) s.tryAbort(ex))
|
||||
}
|
||||
override def postStop(): Unit =
|
||||
// avoid creating exception in happy case since it uses self.toString which is somewhat slow
|
||||
if (activeInterpreters.nonEmpty || newShells.nonEmpty) {
|
||||
val ex = AbruptTerminationException(self)
|
||||
activeInterpreters.foreach(_.tryAbort(ex))
|
||||
activeInterpreters = Set.empty[GraphInterpreterShell]
|
||||
newShells.foreach(s => if (tryInit(s)) s.tryAbort(ex))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue