RFR: 8170305: URLConnection doesn't handle HTTP/1.1 1xx (informational) messages [v3]
Jaikiran Pai
jpai at openjdk.org
Mon Sep 12 09:42:38 UTC 2022
On Mon, 12 Sep 2022 07:45:44 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> Can I please get a review of this change which proposes to fix https://bugs.openjdk.org/browse/JDK-8170305?
>>
>> The commit in this PR changes the internal implementation of `HttpURLConnection` to ignore interim informational 1xx responses from server and continue to wait for the final response. This is a similar fix to what we did in the new `HttpClient` API in https://github.com/openjdk/jdk/pull/10169.
>>
>> A new test has been added to use the `HttpURLConnection` to reproduce the issue and verify the fix.
>>
>> tier1, tier2 and tier3 testing is in progress with this change.
>
> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
>
> Add a log message when ignorning 1xx responses
Hello Michael, I could reproduce the hang locally after a few attempts. This was a bug in the test server which I've now fixed in the updated version of the PR.
What was happening was that the client upon seeing an unexpected 101 would close the connection and throw a (client side) IOException. The `HttpURLConnection` however has certain code which retries a (`GET`) request on `IOException`. The test server upon seeing a connection closure from the client would stop `accept()`ing any more connections but would still have an `ESTABLISHED` server socket listening on that host/port. So with no one "accepting" the connection, the client side would time out waiting for the server to respond. This has now been fixed in the test specific server and I've run this test a few times to make sure this now passes. I'll also run some CI runs with a `--test-repeat` just to be sure it doesn't have any other issues.
-------------
PR: https://git.openjdk.org/jdk/pull/10229
More information about the net-dev
mailing list