-
Notifications
You must be signed in to change notification settings - Fork 181
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
Improve CancellationException
#3039
Improve CancellationException
#3039
Conversation
Motivation: 1. `H2ClientParentConnectionContext.StacklessCancellationException` was reused by `SpliceFlatStreamToMetaSingle`, which created a false impression in logs that this exception is related to HTTP/2. 2. There is not much value in a stacktrace for `CancellationException` in `BeforeFinallyHttpOperator`. Modifications: 1. Make `H2ClientParentConnectionContext.StacklessCancellationException` a top level class. 2. Create a `StacklessCancellationException` in http-utils module for `BeforeFinallyHttpOperator`. 3. Add exception message in `DefaultBlockingIterableProcessor`. Result: Easier for users to reason about received `CancellationException`.
|
||
import java.util.concurrent.CancellationException; | ||
|
||
final class StacklessCancellationException extends CancellationException { |
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 was not sure if it's worth making it public in a module like concurrent-internal
and created a copy for now. Can move if someone prefers.
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.
Feels a bit confusing to have the same exception in two different places, especially since http-netty depends on utils?
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.
Actually, I changed my mind. It's worth capturing the full stack-trace if we capture the Subscriber's stack-trace instead of the netty transport stack-trace. Updated PR
Motivation:
H2ClientParentConnectionContext.StacklessCancellationException
was reused bySpliceFlatStreamToMetaSingle
, which created a false impression in logs that this exception is related to HTTP/2.CancellationException
inBeforeFinallyHttpOperator
instead of a netty stack-trace, it will help to debug paths that subscribe to the payload post cancel.Modifications:
H2ClientParentConnectionContext.StacklessCancellationException
a top-level class.CancellationException
withPublisher.defer(...)
inBeforeFinallyHttpOperator
.DefaultBlockingIterableProcessor
.Result:
Easier for users to reason about received
CancellationException
.