-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add suppressed failures in Callback failed #11435
Add suppressed failures in Callback failed #11435
Conversation
If an exception is thrown during failure handling, then record the original failure as a suppressed Throwable on the thrown exception
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Callback.java
Show resolved
Hide resolved
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.
Looks good for the problem at hand.
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Callback.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Callback.java
Outdated
Show resolved
Hide resolved
I worry that all of these suppressed exceptions might reveal internals that we don't want to. |
} | ||
finally | ||
catch (Throwable t) |
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.
Please use same style as line 295.
cb2.failed(x); | ||
} | ||
|
||
Callback.failed(cb2, x); |
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.
Put this back inside a finally
.
@@ -533,7 +572,7 @@ public void succeeded() | |||
@Override | |||
public void failed(Throwable x) | |||
{ | |||
callback.failed(x); | |||
Callback.failed(callback, x); | |||
super.failed(x); |
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.
Change this to have super.failed()
inside a finally
, so it gets called in all cases.
For better recording of issues like #11431
If an exception is thrown during failure handling, then record the original failure as a suppressed
Throwable
on the thrown exception