RFR: 8304963: HttpServer closes connection after processing HEAD after JDK-7026262
Daniel Jeliński
djelinski at openjdk.org
Mon Mar 27 20:00:04 UTC 2023
On Mon, 27 Mar 2023 18:37:58 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
> This PR fixes a regression introduced in [JDK-7026262](https://bugs.openjdk.org/browse/JDK-7026262); we started closing the exchange instead of the output stream, and exchange closes the connection when wrapped stream is not set. As an unintended side effect, the server started closing connections after handling a HEAD request.
>
> The proposed change is to set the wrapped stream to a zero-length FixedLengthOutputStream before closing the exchange. This allows the connection to be reused.
>
> The attached test verifies if 2 consecutive HEAD requests use the same connection. It succeeds with the proposed change, fails without it. All other tier1-3 tests continue to pass.
I did 20 repetitions of all jdk_net tests on all platforms; there were some failures related to JDK-8304962, but nothing else. I'll run some more tests overnight and will integrate tomorrow morning if nothing else comes up.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13193#issuecomment-1485780942
More information about the net-dev
mailing list