Integrated: 8282726: java/net/vthread/BlockingSocketOps.java timeout/hang intermittently on Windows
Alan Bateman
alanb at openjdk.org
Tue Nov 21 14:08:17 UTC 2023
On Mon, 20 Nov 2023 16:08:10 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> This is a Windows specific issue where a virtual thread attempting to establish a connection appears to hang, and the test eventually times out. It initially looked like an issue on older releases of Windows but it turns out to be an issue that arises when a SOCKET handle is recycled quickly. Thanks to Daniel Jeliński for spending time to find a way to reproduce this quickly, up to now it was too intermittent and needed tens of thousands of runs to have some chance of reproducing.
>
> When a SOCKET has been polled, the event is disabled rather than removed from wepoll / AFD poll. When the SOCKET is closed and immediately recycled then there is a race with the close event and registration of the "new" socket for events. The change that we've tested is to remove the event after polling. This is done virtual thread "client" rather than the poller to avoid racing with an async close.
>
> As part of this change I've removed a temporary change to the Windows Pipe implementation and also remove the connect timeout that went into a few tests to workaround the issue.
This pull request has now been integrated.
Changeset: 21a59b9f
Author: Alan Bateman <alanb at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/21a59b9f4e46ebd32cff8f1000fe9ad56c918431
Stats: 42 lines in 8 files changed: 9 ins; 11 del; 22 mod
8282726: java/net/vthread/BlockingSocketOps.java timeout/hang intermittently on Windows
Reviewed-by: djelinski
-------------
PR: https://git.openjdk.org/jdk/pull/16742
More information about the nio-dev
mailing list