RFR: 8334719: (se) Deferred close of SelectableChannel may result in a Selector doing the final close before concurrent I/O on channel has completed [v2]

Jaikiran Pai jpai at openjdk.org
Tue Jun 25 16:35:10 UTC 2024


On Tue, 25 Jun 2024 15:19:56 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   don't inject NIO_ACCESS instead patch InetSocketAddress to introduce crafted delays
>
> test/jdk/java/nio/channels/Selector/java.base/java/net/InetSocketAddress.java line 39:
> 
>> 37:             return false;
>> 38:         }
>> 39:     };
> 
> A simpler way to do this is to just add a setDelay method or even a constructor that allows the delay to be specified when creating the object.  That will allow the ThredLocal to go away and make the test a bit simpler.

The use of ThreadLocal was to add fine grained delays to avoid delaying all the places where InetSocketAddress gets used and increasing the test execution time. I will remove the ThreadLocal and see how big an impact it has on test durations.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19879#discussion_r1653158349


More information about the nio-dev mailing list