mdedetrich commented on code in PR #981:
URL: https://github.com/apache/incubator-pekko/pull/981#discussion_r1464351731


##########
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:
##########
@@ -614,14 +607,31 @@ import pekko.util.ccompat.JavaConverters._
 
       override def onDownstreamFinish(cause: Throwable): Unit = {
         substreamCancelled = true
-        if (isClosed(in) || propagateSubstreamCancel(cause)) {
-          cancelStage(cause)
-        } else {
-          // Start draining
-          if (!hasBeenPulled(in)) pull(in)
+        decider(cause) match {
+          case Supervision.Stop =>
+            cancelStage(cause)
+          case Supervision.Resume =>
+            if (isClosed(in)) cancelStage(cause)
+            else {
+              // Start draining
+              if (!hasBeenPulled(in)) pull(in)
+            }
+          case Supervision.Restart =>
+            if (isClosed(in)) completeStage()
+            else {
+              restartState()
+              // Start draining
+              if (!hasBeenPulled(in)) pull(in)
+            }

Review Comment:
   > I mean I can't see how this will solve the origin problem. when restarting 
the flow, the connected sink is not restarted.
   
   Thats actually the point I am making which is that this PR's is no longer 
about solving the original problem (i.e. 
https://github.com/apache/incubator-pekko/issues/980) but is now just generally 
about supporting `Supervision.restart` for `SubFlow` in way that makes sense. 
https://github.com/apache/incubator-pekko/issues/980 is going to be solved 
another way that makes more sense (which we already discussed).
   
   So with that being said, if we had a design goal of adding support for 
`Supervision.restart` generally in `SubFlow`, does this current implementation 
make sense or am I missing something?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org
For additional commands, e-mail: notifications-h...@pekko.apache.org

Reply via email to