[jdk17u-dev] RFR: 8358764: (sc) SocketChannel.close when thread blocked in read causes connection to be reset (win) [v2]

Voznia Anton duke at openjdk.org
Wed Oct 29 11:24:14 UTC 2025


On Sun, 26 Oct 2025 20:41:30 GMT, Goetz Lindenmaier <goetz at openjdk.org> wrote:

>> I backport this for parity with 17.0.18-oracle.
>> 
>> Needed resolve and adaptions:
>> 
>> Net.java:  resolved static initializer.
>> SocketChannelImpl.java: In implCloseBlockingMode(), the code guarded by the new condition is not in 17. Omitted.
>> Net.c: Copyright.
>> 
>> The test exercises platform and virtual threads.
>> I simplified this to what is supported in 17.
>> See extra commit.
>
> Goetz Lindenmaier has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add code from 8284161 along with fix of this change

src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java line 1012:

> 1010:      * threads that are blocked in I/O operations on this channel. If there are no
> 1011:      * virtual threads blocked in I/O operations on this channel then the channel's
> 1012:      * socket is closed. If there are virtual threads in I/O then the final close is

LGTM in general.
Since Java 17 doesn't have virtual threads, perhaps remove the mention of them from the comment.

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

PR Review Comment: https://git.openjdk.org/jdk17u-dev/pull/4076#discussion_r2472620393


More information about the jdk-updates-dev mailing list