You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #10543 the stack overflow in HttpStreamOverHTTP3.consumeAvailable() was worked around by setting an error chunk in onFailure. As a reminder, here is the relevant part of the stack where the infinite loop happened:
at org.eclipse.jetty.http3.server.internal.HTTP3StreamServer.notifyFailure(HTTP3StreamServer.java:129)
at org.eclipse.jetty.http3.HTTP3Stream.onFailure(HTTP3Stream.java:375)
at org.eclipse.jetty.http3.HTTP3Session.onStreamFailure(HTTP3Session.java:843)
at org.eclipse.jetty.http3.HTTP3StreamConnection.processDataFrames(HTTP3StreamConnection.java:146)
at org.eclipse.jetty.http3.HTTP3StreamConnection.receive(HTTP3StreamConnection.java:242)
at org.eclipse.jetty.http3.HTTP3Stream.readData(HTTP3Stream.java:178)
at org.eclipse.jetty.http3.server.internal.HttpStreamOverHTTP3.read(HttpStreamOverHTTP3.java:150)
at org.eclipse.jetty.server.HttpStream.consumeAvailable(HttpStream.java:117)
at org.eclipse.jetty.http3.server.internal.HttpStreamOverHTTP3.consumeAvailable(HttpStreamOverHTTP3.java:490)
at org.eclipse.jetty.server.internal.HttpChannelState.onFailure(HttpChannelState.java:492)
at org.eclipse.jetty.http3.server.internal.HttpStreamOverHTTP3.onFailure(HttpStreamOverHTTP3.java:531)
at org.eclipse.jetty.http3.server.internal.ServerHTTP3StreamConnection.onFailure(ServerHTTP3StreamConnection.java:82)
at org.eclipse.jetty.http3.server.HTTP3ServerConnectionFactory$HTTP3StreamListener.onFailure(HTTP3ServerConnectionFactory.java:164)
at org.eclipse.jetty.http3.server.internal.HTTP3StreamServer.notifyFailure(HTTP3StreamServer.java:129)
The root cause of the infinite loop is that HTTP3StreamConnection.fill() rethrows a RuntimeException when the underlying EndPoint.fill() call throws IOException, unlike H1 where HttpConnection.fillRequestBuffer() catches IOException and returns -1. So eventually HTTPStreamOverHttp3.read() throws instead of returning an error chunk, which ends up calling HttpChannelState.onFailure() which calls HttpStreamOverHTTP3.consumeAvailable() and we get that infinite loop that leads to a stack overflow.
Unfortunately, some tests (org.eclipse.jetty.http3.tests.ClientServerTest.testResponseHeadersTooLarge(), org.eclipse.jetty.http3.tests.StreamIdleTimeoutTest.testClientStreamIdleTimeout() and org.eclipse.jetty.http3.tests.StreamIdleTimeoutTest.testServerStreamIdleTimeout()) rely on this exception being thrown.
This all needs to be reworked so that the temporary fix made in #10543 isn't needed anymore.
The text was updated successfully, but these errors were encountered:
Jetty version(s)
12.0.x
Description
In #10543 the stack overflow in
HttpStreamOverHTTP3.consumeAvailable()
was worked around by setting an error chunk inonFailure
. As a reminder, here is the relevant part of the stack where the infinite loop happened:The root cause of the infinite loop is that
HTTP3StreamConnection.fill()
rethrows aRuntimeException
when the underlyingEndPoint.fill()
call throwsIOException
, unlike H1 whereHttpConnection.fillRequestBuffer()
catches IOException and returns -1. So eventuallyHTTPStreamOverHttp3.read()
throws instead of returning an error chunk, which ends up callingHttpChannelState.onFailure()
which callsHttpStreamOverHTTP3.consumeAvailable()
and we get that infinite loop that leads to a stack overflow.Unfortunately, some tests (
org.eclipse.jetty.http3.tests.ClientServerTest.testResponseHeadersTooLarge()
,org.eclipse.jetty.http3.tests.StreamIdleTimeoutTest.testClientStreamIdleTimeout()
andorg.eclipse.jetty.http3.tests.StreamIdleTimeoutTest.testServerStreamIdleTimeout()
) rely on this exception being thrown.This all needs to be reworked so that the temporary fix made in #10543 isn't needed anymore.
The text was updated successfully, but these errors were encountered: