RFR[11] of JDK-8208280,java/nio/channels/Selector/RegisterDuringSelect.java fails with "key not removed from key set"
Hamlin Li
huaming.li at oracle.com
Thu Aug 30 14:48:58 UTC 2018
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 is important to test that the key has been added to the key-set
> while a selection operation is in progress.
>
> A minor point is that Test doesn't need the t field, it can be a local
> in the test method. Also L72 is a left over from a previous iteration
> and can be removed.
I have update the webrev as you suggested, please help to review it
again: http://cr.openjdk.java.net/~mli/8208280/webrev.04/
Thank you
-Hamlin
>
> -Alan
More information about the nio-dev
mailing list