Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upPropagate stream cancellation causes #27266
Merged
Conversation
akka-ci
commented
Jul 4, 2019
|
Test FAILed. |
akka-stream/src/main/scala/akka/stream/impl/ReactiveStreamsCompliance.scala
Outdated
Show resolved
Hide resolved
|
Looks good to me, but I am just getting back into Akka streams after a few years. |
4a3ca06
to
58951cf
akka-ci
commented
Jul 17, 2019
|
Test FAILed. |
58951cf
to
05fa234
akka-ci
commented
Jul 17, 2019
|
Test FAILed. |
05fa234
to
5eb51cc
akka-ci
commented
Jul 17, 2019
|
Test FAILed. |
3125d0c
to
4e2c79e
akka-ci
commented
Jul 23, 2019
|
Test PASSed. |
1 similar comment
akka-ci
commented
Jul 23, 2019
|
Test PASSed. |
| object SubscriptionWithCancelException { | ||
| case object NoMoreElementsNeeded extends RuntimeException with NoStackTrace | ||
| case object StageWasCompleted extends RuntimeException with NoStackTrace | ||
| } |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
jrudolph
Aug 8, 2019
Author
Member
Yeah, hard to say. Maybe the default exception should have a less verbose shortcut anyway and then the name doesn't matter as much in user facing API.
fd0f47a
to
632896f
akka-ci
commented
Aug 16, 2019
|
Test PASSed. |
johanandren
added a commit
to johanandren/akka
that referenced
this pull request
Aug 28, 2019
* base functionality * fix-restart-flow * Fix subSource / subSink cancellation handling * GraphStage-fix * Fix ambiguity between complete and cancellation (for isAvailable / grab) * rename lastCancellationCause * add mima * fix cancellation cause propagation in OutputBoundary * Fix cancellation cause propagation in SubSink * Add cancellation cause logging to Flow.log * add more comments about GraphStage portState internals * Add some assertions in onDownstreamFinish to prevent wrong usage * Also deprecate onDownstreamFinish() so that no one calls the wrong one accidentally * add SubSinkInlet.cancel(cause) * Propagate causes in two other places * Suggest to use `cancel(in, cause)` but don't deprecate old one
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
jrudolph commentedJul 4, 2019
•
edited by raboof
This PR is focussed on adding APIs and machinery to provide cancellation causes across stages and reactive streams interfaces. The new APIs are (so far) completely optional:
SubscriptionWithCancelExceptionif it wants to support that featureGraphStage.cancel(cause)method that can be used to provide a cause (otherwise,SubscriptionWithCancelException.NoMoreElementsNeededis used)OutHandler.onDownstreamFinished(cause)method to override if you want access to (or to propagate) the cancellation cause. If not overridden it calls the old method.These changes should be completely transparent and only noticeable to those parties that implement the APIs.
It still needs to be discussed, if providing a cause should be optional or not. As a follow up we should
onDownstreamFinishand make sure to use the new version and propagate causes if possiblecancelStagewill propagate to output, currently it completes neighboring outputs but it should maybe fail them by default instead.I'll create follow up tickets to those.
Refs #23908