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

Alan Bateman alanb at openjdk.org
Wed Jun 26 11:32:10 UTC 2024


On Wed, 26 Jun 2024 11:01:59 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   don't use reflection in the test
>
> test/jdk/java/nio/channels/Selector/DeferredClose/java.base/java/net/InetSocketAddress.java line 34:
> 
>> 32:     private static final long serialVersionUID = 5076001401234631237L;
>> 33: 
>> 34:     public static boolean enableDelay;
> 
> should it be volatile?

The main thing for this test is that it's easy to maintain because someone looking at the test in a few years (maybe because of a test failure) will want to understand it quickly. I assume it doesn't need to be a public static field, it could be a private instance field. I think that would remove the need for the beforeAll/afterAll as it would allow the test to just set the delay for the ISA used by the test. I don't want to water Jai's time on too many iterations on this test, I think the main thing is that it is reliable and easy to maintain.

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

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


More information about the nio-dev mailing list