-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace SubstreamCancelStrategy with SupervisionDecider for Split #252
Replace SubstreamCancelStrategy with SupervisionDecider for Split #252
Conversation
fcf46b5
to
b7ff620
Compare
I will read this PR in more detail, and add feedback later. |
The original issue is : akka/akka#31394 |
Pekko-HTTP is using the |
Sure I can do this, I would expect that pekko-http 1.1.x would depend on pekko 1.1.x so if there are any breaking changes in pekko-http it would just be for 1.1.x. I can check locally what impact this change would have against pekko-http |
See apache/pekko-http#371 which is related |
b7ff620
to
93710fd
Compare
So I have decided to finish off this PR (which just involved updating the documentation) since it makes sense to release this as part of Pekko 1.1.0. Of note is that I had to add a new Regarding the behavioural changes, as you can see from https://github.com/mdedetrich/akka-apache/blob/main/akka-docs/src/main/paradox/project/migration-guide-2.5.x-2.6.x.md?plain=1#L17-L18, doing behavioural changes across minor updates do happen as long as there is a justification for it and I believe this PR does hit that threshold. These changes are clearly documented in There is one other final note, the current implementation of this PR alias's the behaviour of |
1487124
to
f03c736
Compare
Pinging @He-Pin , @pjfanning , @jrudolph and @raboof since I forgot to do so earlier. |
docs/src/main/paradox/stream/operators/Source-or-Flow/splitAfter.md
Outdated
Show resolved
Hide resolved
f03c736
to
32c5d2c
Compare
@pjfanning All apostrophe's have been removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - seems sensible to not need the SubstreamCancelStrategy. I would like to see some other approvals though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@mdedetrich I have left some comments |
I can't see any, I think you forgot to submit? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated my comments
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala
Show resolved
Hide resolved
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala
Show resolved
Hide resolved
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala
Show resolved
Hide resolved
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala
Show resolved
Hide resolved
@He-Pin Responded to comments. I think that when you looked at the PR you didn't expand out the diff's and missed the fact that a lot of the code you commented on was within |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one is ok, I missed it's was internalApi.
Thanks I will leave the PR open till the end of the month (given that its christmas) to see if anyone else wants to comment on it, at that point I will merge it. |
32c5d2c
to
2b2958b
Compare
2b2958b
to
5df953f
Compare
The commit I just pushed was adding |
Im going to go ahead and merge this, largely so that |
Just wanted to mention that since the changes in this PR were published as a snapshot, pekko-http tests ran against these changes and passed without any problems (see https://github.com/apache/incubator-pekko-http/actions/runs/7353051075/job/20018534864) |
This PR is the equivalent of akka/akka#31415 but for Pekko, I would recommend reading the conversation thread from that PR to get the context/justification for the feature.
The very brief summary is that the
SubstreamCancelStrategy
abstraction that is only used when creating aSubFlow
(via usage ofsplitWhen
and other associated functions) is not needed since Pekko already provides a generic streams abstraction for this called aSupervisionDecider
. It can even be said that theSubstreamCancelStrategy
is worse than pointless duplication because unlikeSupervisionDecider
you can't do things like log the thrown exception in theSubFlow
(this is actually the main impetus for the change, because as user I had the situation whereSubFlow
was throwing exceptions and I had no idea what was going on because it wasn't logging them via a customSupervisionDecider
which I defined, even worse because its not possible to change the already definedSubstreamCancelStrategy
you have to do annoying workarounds to log any potentially thrown exceptions in aSubFlow
).Note that this change although not source/binary breaking it does change behaviour because the default
SupervisionDecider
is to stop in case of an exception where as the defaultSubstreamCancelStrategy
default is to ignore and keep on going (this is also the reason behind the test changes in the PR). As stated in the original PR, even though it is a breaking behavioural change, since it fails more explicitly its much easier for a user to notice (see akka/akka#31415 (review)).Due to this behaviour change the PR was intended to be looked at by @raboof and @jrudolph to get buy in/opinion whether this change is acceptable (see akka/akka#31415 (comment)), would be great to get feedback on this PR's premise (because otherwise we have to create an entirely new set of functions which overall I think is worse proposition).
PR is currently draft because I didn't update the docs for the behavioural change. If @jrudolph / @raboof are happy with this change (along with anyone else that has strong experience with akka/pekko-streams, i.e. @He-Pin ) then I will update the PR with proper documentation explaining all the changes. It will also target Pekko 1.1.x.