RFR[11] of JDK-8208280,java/nio/channels/Selector/RegisterDuringSelect.java fails with "key not removed from key set"

Alan Bateman Alan.Bateman at oracle.com
Thu Aug 30 15:45:31 UTC 2018



On 30/08/2018 15:48, Hamlin Li wrote:
>
>
> On 2018/8/30 7:39 PM, Alan Bateman wrote:
>> On 30/08/2018 04:33, Hamlin Li wrote:
>>> Thank you for detailed reviewing, I have modified as you suggested, 
>>> please review it again: 
>>> http://cr.openjdk.java.net/~mli/8208280/webrev.03/
>> This is much cleaner but I'm still concerned that the test method is 
>> registering the channel with the selector - I think this should be in 
>> the test body to make it more obvious what is bring tested.
>>
>> In terms of the tests then the first one has changed in a subtle way, 
>> it should be:
>>
>> SelectorUtils.spinUntilLocked(...)
>> SelectionKey key = sc.register(...);
>> try {
>>     if (!sel.keys().contains(key)) throw new RuntimeException(...);
>> } finally {
>>     sel.wakeup();
>> }
> good catch.
This issue still exists in webrev.04. The check that the key-set is 
updated should be done before the wakeup. I also think the second test 
should check interestOps() before the wakeup but that isn't critical. If 
you address these points then I think the test will be good to go and 
doesn't need another webrev.

-Alan


More information about the nio-dev mailing list