-
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
Fix missing notifyRemoteAsyncErrors http config wiring #11897
Fix missing notifyRemoteAsyncErrors http config wiring #11897
Conversation
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
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 add a test case.
…0.x/wire-isNotifyRemoteAsync
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@@ -437,7 +437,7 @@ public Runnable onFailure(Throwable x) | |||
// Notify the failure listeners only once. | |||
Consumer<Throwable> onFailure = _onFailure; | |||
_onFailure = null; | |||
Runnable invokeOnFailureListeners = onFailure == null ? null : () -> | |||
Runnable invokeOnFailureListeners = onFailure == null || !getHttpConfiguration().isNotifyRemoteAsyncErrors() ? null : () -> |
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'm not sure this is the right place to check for isNotifyRemoteAsyncErrors()
, because not all errors that arrive here are remote async errors.
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'm not sure there is a way to reliably discriminate errors. Maybe this feature is specific to ee* environments?
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.
In Jetty 11, the check for notifyRemoteAsyncErrors
was done in the HTTP/2 and HTTP/3 layers, not generically.
I think we should restore that.
The idea would be to introduce an onRemoteFailure()
method that is only called from H2 and H3, and have this new method delegate to onFailure()
with an extra parameter, so that pending reads and writes are notified, but listeners are only invoked if the extra parameter is true.
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.
Pushed an attempt at that; two observations:
- having that notification filtering logic in core means it's not needed in ee* anymore
- H3 does not have client resets?!
jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/HttpOutput.java
Show resolved
Hide resolved
...e10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletChannelState.java
Outdated
Show resolved
Hide resolved
protected Session newHttp2ClientSession(Session.Listener listener) throws Exception | ||
{ | ||
String host = "localhost"; | ||
int port = ((NetworkConnector)connector).getLocalPort(); | ||
InetSocketAddress address = new InetSocketAddress(host, port); | ||
FuturePromise<Session> promise = new FuturePromise<>(); | ||
http2Client.connect(address, listener, promise); | ||
return promise.get(5, TimeUnit.SECONDS); | ||
} |
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.
No, the point of the tests in this module is to run for all transports.
This is HTTP/2 specific, so it should be moved to the jetty-http2-tests
module.
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 agree this isn't an idea place, but the jetty-http2-tests
module is under jetty-core
, it does not and cannot depend on ee10.
jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/HttpChannelState.java
Outdated
Show resolved
Hide resolved
@@ -196,6 +206,29 @@ protected void startClient(Transport transport) throws Exception | |||
client.start(); | |||
} | |||
|
|||
protected Session newHttp2ClientSession(Session.Listener listener) throws Exception |
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.
Same as ee10.
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.
Same response.
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.
See comments.
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
…0.x/wire-isNotifyRemoteAsync
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
…0.x/wire-isNotifyRemoteAsync
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
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 remove all booleans.
Just do the instanceof EOFException in HttpStreamOverHTTP3.onFailure().
{ | ||
if (LOG.isDebugEnabled()) | ||
LOG.debug("failure on {}", this, failure); | ||
LOG.debug("{}failure on {}", remote ? "remote " : "", this, failure); |
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.
LOG.debug("{}failure on {}", remote ? "remote " : "", this, failure); | |
LOG.debug("{} failure on {}", remote ? "remote" : "local", this, failure); |
{ | ||
if (LOG.isDebugEnabled()) | ||
LOG.debug("Processing stream failure on {}", stream, failure); | ||
LOG.debug("Processing {}stream failure on {}", remote ? "remote " : "", stream, failure); |
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.
LOG.debug("Processing {}stream failure on {}", remote ? "remote " : "", stream, failure); | |
LOG.debug("Processing {} stream failure on {}", remote ? "remote" : "local", stream, failure); |
{ | ||
session.onSessionFailure(error, reason, failure); | ||
session.onSessionFailure(error, remote, reason, failure); |
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.
Can you keep the parameter order to be [remote, error, reason] like elsewhere?
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
(#11897) Fixed missing notifyRemoteAsyncErrors http config wiring and add tests Signed-off-by: Ludovic Orban <lorban@bitronix.be>
HttpConfiguration.isNotifyRemoteAsyncErrors()
is not used anywhere in Jetty 12.Fix this by adding the necessary check.