-
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 stack overflow in HttpStreamOverHttp3.consumeAvailable()
#10562
Fix stack overflow in HttpStreamOverHttp3.consumeAvailable()
#10562
Conversation
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 wondering if we should start using SoftReference
in our RetainableByteBuffer
to link to the ByteBuffer
. We would also have a hard reference, which we would set when the buffer is in the pool, and null when we allocate the buffer. If we ever get a buffer in the collection queue, we then know that somebody took a RetainableByteBuffer
and leaked it. However, I'm not exactly sure how we would recover from that, as I'm not sure how we can use the collected ByteBuffer
to find the RetainableByteBuffer
reference?
...t-transports/src/test/java/org/eclipse/jetty/test/client/transport/HttpClientStreamTest.java
Outdated
Show resolved
Hide resolved
...t-transports/src/test/java/org/eclipse/jetty/test/client/transport/HttpClientStreamTest.java
Outdated
Show resolved
Hide resolved
@gregw Looking at the That looks feasible and would make our pools totally resistant to leaks like they used to be. We should investigate this idea. I filed #10569 so that we can come back to that subject later on. |
...t-transports/src/test/java/org/eclipse/jetty/test/client/transport/HttpClientStreamTest.java
Outdated
Show resolved
Hide resolved
...t-transports/src/test/java/org/eclipse/jetty/test/client/transport/HttpClientStreamTest.java
Outdated
Show resolved
Hide resolved
...t-transports/src/test/java/org/eclipse/jetty/test/client/transport/HttpClientStreamTest.java
Outdated
Show resolved
Hide resolved
...t-transports/src/test/java/org/eclipse/jetty/test/client/transport/HttpClientStreamTest.java
Outdated
Show resolved
Hide resolved
...-http3-server/src/main/java/org/eclipse/jetty/http3/server/internal/HttpStreamOverHTTP3.java
Show resolved
Hide resolved
…rflow Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
…owing when the stream is finished to avoid a stack overflow Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
6baa204
to
3672d7c
Compare
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@sbordet I streamlined the H1 But the code I added to H3 should be considered a workaround. There is something more fundamental that is wrong with the way H3 handles exceptions in the lowest layers. I'm going to open an issue about it. |
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 good with this for this release cycle, so long as we get onto #10569 asap next cycle.
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/internal/HttpConnection.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/internal/HttpConnection.java
Show resolved
Hide resolved
...t-transports/src/test/java/org/eclipse/jetty/test/client/transport/HttpClientStreamTest.java
Outdated
Show resolved
Hide resolved
...t-transports/src/test/java/org/eclipse/jetty/test/client/transport/HttpClientStreamTest.java
Outdated
Show resolved
Hide resolved
… when needed Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
…ementations Signed-off-by: Ludovic Orban <lorban@bitronix.be>
…ementations Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Only H3 seems to suffer from the stack overflow problem.
What I do not like about this "fix":
Fixes #10543