RFR: 8304962: sun/net/www/http/KeepAliveCache/B5045306.java: java.lang.RuntimeException: Failed: Initial Keep Alive Connection is not being reused

Jaikiran Pai jpai at openjdk.org
Tue Mar 28 06:56:34 UTC 2023


On Mon, 27 Mar 2023 19:38:01 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> This PR fixes intermittent test failures.
> 
> The test was broken by 95ca94436d12974d98b1b999f9cc8408d64cbe3c, which changed the `/firstCall` handler to return chunked response (second parameter to `sendResponseHeaders` was `0`). The test verifies the behavior of KeepAliveStreamCleaner, which only works on responses containing `Content-Length` header, and sometimes fails on chunked streams.
> 
> ~~Additionally I removed the unnecessary byte-to-character-to-byte conversion introduced in the same commit.~~
> Fixed the test server output. The PrintWriter printed the result of `toString()` call on a byte array instead of sending the byte array contents.
> 
> No failures after 50 test runs. Without the change the test failed 3 times in 10.

Marked as reviewed by jpai (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/13194#pullrequestreview-1360326639


More information about the net-dev mailing list