RFR: 8358764: (sc) SocketChannel.close when thread blocked in read causes connection to be reset (win)
Jaikiran Pai
jpai at openjdk.org
Wed Jun 11 07:53:29 UTC 2025
On Mon, 9 Jun 2025 19:17:16 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> On Windows, if a platform thread is blocked in SocketChannel.read, and another thread closes the channel, then Windows abruptly closes the connection (RST). In releases prior to JDK 11, the connection was shutdown for writing before closing so the connection was closed gracefully, an unexpected behavior change
>
> implCloseBlockingMode is changed to shutdown the connection for writing on Windows, no change in behavior for other platforms.
The changes look good to me.
-------------
Marked as reviewed by jpai (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/25700#pullrequestreview-2916038434
More information about the nio-dev
mailing list