On Tue, 22 Nov 2022 17:24:40 GMT, Daniel Fuchs <[email protected]> wrote:

> The java/net/httpclient/SpecialHeadersTest.java test has been observed 
> failing once, due to a selector thread still running after all operations had 
> terminated. This change slightly alter the test logic to check the shared 
> client only at the end of the test when all methods have been executed, and 
> focussed the checks performed by a test method to the only clients that this 
> method is using. This may or may not prevent the observed issue to ever 
> reproducing, but should at least provide more information on where the 
> selector manager thread is at the time it is observed running, should the 
> test fail again:
> the logic of the HttpClient should have woken up the selector when the last 
> operation finished, which should have ensured a prompt termination of the 
> thread.
> In addition this change fixes a small race condition in the logic that 
> attempts to decide if the selector is still alive: the selector should be 
> considered alive until its run() method has been called and has exited (or 
> Thread::start has thrown).

This pull request has now been integrated.

Changeset: d83a07b7
Author:    Daniel Fuchs <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/d83a07b72cfd4dc42c5d4815262fcba05c653bd5
Stats:     103 lines in 4 files changed: 79 ins; 0 del; 24 mod

8297200: java/net/httpclient/SpecialHeadersTest.java failed once in 
AssertionError due to selector thread remaining alive

Reviewed-by: jpai

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

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

Reply via email to