-
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
Possible buffer corruption in HTTP/2 session failures #4967
Comments
The issue can be reproduced with buffer pooling disabled on the client, but cannot be reproduced with buffer pooling disabled on the server. It must therefore be a server issue. |
This may be another, slightly different, occurrence of #4855. The solution for #4855 assumes that the frame generation is synchronous at the time of |
Improved logging. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Partially reverted the changes introduced in #4855, because they were working only when sends were synchronous. Introduced ByteBufferPool.remove(ByteBuffer) to fix the issue. Now when a concurrent failure happens while frames are being generated or sent, the buffer is discarded instead of being recycled, therefore resolving the buffer corruption. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Fixed test failure after merge. Made sure the lastStreamId is updated when resetting a new stream since it has been seen by the server and handled. This avoids that a new stream arriving during shutdown is interpreted as a connection failure, therefore failing all pending streams - we want them to complete. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Jetty version
9.4.30
Description
Run the CometD benchmark with HTTP/2, all defaults but large message content (for example 32768 bytes).
The run will fail because of TCP congestion and HTTP/2 flow control stalls that eventually make the client time out and cancel all requests.
This is kind of expected in HTTP/2 since a single 32 KiB message is (with default configuration) fan-out 10 times, likely to clients on the same TCP connection (since there are so few TCP connections, as each one supports 128 concurrent streams).
Eventually, we see this in DEBUG logs for the same thread (and the issue is reproducible):
The buffer contains multiple frames, and I have seen multiple times that a frame is parsed with length=1 just before the faulty frame
Parsed [DATA|256|0|397612]
.Note that this seems to be a rare case: normal CometD benchmark runs never fail, and it seems to be related to the fact that we are failing a lot of streams in one connection (due to timeout).
Since stream #397612 is bogus, this leads to the failure of the whole connection.
The text was updated successfully, but these errors were encountered: