On Mon, 1 Aug 2022 11:01:01 GMT, Daniel Jeliński <[email protected]> wrote:

> This patch fixes a race condition in KeepAliveProperty test. The client 
> thread could read the `pass` field and fail the test before the server thread 
> had a chance to set the field value to `true`. The fix adds an explicit wait 
> for the server thread to complete.
> 
> Without this patch, the failure can be easily reproduced by adding a 
> `Thread.sleep(100);` before `pass = !expectClose;`.

Marked as reviewed by dfuchs (Reviewer).

test/jdk/sun/net/www/http/KeepAliveCache/KeepAliveProperty.java line 174:

> 172:                 throw e;
> 173:         }
> 174:         s.join();

LGTM. The logger at line 141 should be stashed into a static field too to make 
sure it will not be GC'ed before being used.

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

PR: https://git.openjdk.org/jdk/pull/9700

Reply via email to