RFR: 8376479: Http3 test server thread deadlock in ThrowingPublishersInRequest [v4]

Daniel Fuchs dfuchs at openjdk.org
Fri Jan 30 09:52:03 UTC 2026


On Fri, 30 Jan 2026 09:03:56 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> This fixes a deadlock between the thread that reads from the RequestBodyInputStream and the thread that tries to close it in response to a stream reset. See the linked JBS ticket for details.
>> 
>> Tier1 and tier2 tests continue to pass. I verified that with this change there are no busy threads at the end of the test.
>
> Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove duplicate code in current()

Good simplification.

test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http3/Http3ServerStreamImpl.java line 310:

> 308:                         throw new IOException("Stream is closed");
> 309:                     } else {
> 310:                         throw new IOException((IOException)reason);

I would only do this if current == EOF - but it's probably OK to throw immediately. If the stream is being reset before we have read all the bytes, it's probably OK to throw immediately. We know that we have all the bytes when the stream is in DATA_RECVD. We may receive a RESET when in this state, and in this case IIRC the spec allows to switch to RESET_READ and drop the data. If the RESET comes before DATA_RECVD and we have data in the queue we can throw immediately as there is no point in processing the received data anyway. So in all cases throwing immediately is reasonable.

-------------

Marked as reviewed by dfuchs (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29448#pullrequestreview-3727327202
PR Review Comment: https://git.openjdk.org/jdk/pull/29448#discussion_r2745461815


More information about the net-dev mailing list