You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2026/06/20 12:06:20 UTC
[I] AlsoTo should support configurable downstream failure propagation [pekko]
He-Pin opened a new issue, #3104:
URL: https://github.com/apache/pekko/issues/3104
### Motivation
`alsoTo` uses `Broadcast[Out](2, eagerCancel = true)` internally. When the side sink fails or cancels, the entire stream is terminated. Users cannot isolate the side sink — for example, a fire-and-forget logging sink should not kill the main business stream when the logging destination is temporarily unavailable.
### Current behavior
`Flow.scala:4014-4020`:
```scala
protected def alsoToGraph[M](that: Graph[SinkShape[Out], M]): Graph[FlowShape[Out @uncheckedVariance, Out], M] =
GraphDSL.createGraph(that) { implicit b => r =>
import GraphDSL.Implicits._
val bcast = b.add(Broadcast[Out](2, eagerCancel = true))
bcast.out(1) ~> r
FlowShape(bcast.in, bcast.out(0))
}
```
With `eagerCancel = true`, any cancellation from the side sink immediately cancels the entire stream.
### Proposed fix
1. Add a new `alsoTo` overload accepting `propagateCancellation: Boolean = true`
2. When `propagateCancellation = false`, use a custom GraphStage that:
- Forwards elements to both the main downstream and the side sink
- When the side sink cancels/fails, logs a warning and continues forwarding to main downstream only
- When the main downstream cancels, cancels the side sink normally
3. Update both Scala and Java DSLs
4. Add tests for both propagation modes
### References
- Inspired by Akka.NET [#7301](https://github.com/akkadotnet/akka.net/pull/7301)
--
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-unsubscribe@pekko.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [I] AlsoTo should support configurable downstream failure propagation [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed issue #3104: AlsoTo should support configurable downstream failure propagation
URL: https://github.com/apache/pekko/issues/3104
--
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-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [I] AlsoTo should support configurable downstream failure propagation [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed issue #3104: AlsoTo should support configurable downstream failure propagation
URL: https://github.com/apache/pekko/issues/3104
--
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-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [I] AlsoTo should support configurable downstream failure propagation [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on issue #3104:
URL: https://github.com/apache/pekko/issues/3104#issuecomment-4770631467
I think this is a nice addion.
--
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-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org