RFR: 8371903: HttpClient: improve handling of HTTP/2 GOAWAY frames with error code [v8]
EunHyunsu
duke at openjdk.org
Thu Dec 18 18:19:58 UTC 2025
On Thu, 18 Dec 2025 16:39:12 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
>> EunHyunsu has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8371903: Address code review feedback
>
> Occasionally more than one request fails with the GOAWAY exception. I suppose this might be because of a race between the thread that iterates over the list of streams, and another thread adding new streams to the list; the newly added streams may be missed by the iterator, and then are subsequently closed with the connection's termination cause. I only observed the failure 3 times in 2500 repeats.
>
> The exception itself is not visible in the test output; printStackTrace helps a lot in diagnosing test failures, could you add it?
Thank you @djelinski for finding this. I've added `e.printStackTrace()` to make the exception visible in test output.
If I understand correctly, the issue might be a race between `streams.forEach()` in `handleGoAwayWithError()` and other threads adding new streams. If streams 3 and 5 get added while forEach is running (or just after it finishes), they would miss the `closeAsUnprocessed()` call and get closed with the GOAWAY cause instead. Is that the scenario you're thinking of?
The printStackTrace should help confirm what's actually happening. Let me know if there's anything else I should add.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28632#issuecomment-3671535706
More information about the net-dev
mailing list