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]
Alan Bateman
alanb at openjdk.org
Tue Jun 25 18:20:18 UTC 2024
On Tue, 25 Jun 2024 16:32:33 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> 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.
Okay, whatever is easiest. My comment was really to say that a method or constructor would catch any issues at compile-time and avoid any implicit parameters. So what is easiest, this is hard test to write.
My only significant comment is about the execution time and whether we should dial it down a bit to reduce the execution time. It doesn't matter if the test doesn't reproduce every time because the test will run enough times on different systems to exercise the code path.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19879#discussion_r1653320192
More information about the nio-dev
mailing list