JDK 9 RFR of 8172547: (se) Selector.select(Long.MAX_VALUE) fires repeatedly

Brian Burkhalter brian.burkhalter at oracle.com
Wed Jan 18 20:08:59 UTC 2017


I observed some failures with isTimedOut in the test being set to ‘true’ despite the select() thread having been interrupted. This is fixed by the change to the test included below [1]. With this change, the test predictably fails on Windows without the implementation change, but passes with it. the complete patch is at [2].

Thanks,

Brian

[1] Delta: webrev.02 -> webrev.03

--- a/test/java/nio/channels/Selector/SelectTimeout.java
+++ b/test/java/nio/channels/Selector/SelectTimeout.java
@@ -67,7 +67,9 @@
         Thread t = new Thread(() -> {
             try {
                 selector.select(timeout);
-                isTimedOut = true;
+                if (!Thread.currentThread().isInterrupted()) {
+                    isTimedOut = true;
+                }
             } catch (IOException ioe) {
                 theException = ioe;
             }

[2] http://cr.openjdk.java.net/~bpb/8172547/webrev.03/

On Jan 17, 2017, at 11:57 PM, Langer, Christoph <christoph.langer at sap.com> wrote:

> Yep, +1.
> 
>> -----Original Message-----
>> From: nio-dev [mailto:nio-dev-bounces at openjdk.java.net] On Behalf Of Roger
>> Riggs
>> Sent: Dienstag, 17. Januar 2017 21:17
>> To: nio-dev at openjdk.java.net
>> Subject: Re: JDK 9 RFR of 8172547: (se) Selector.select(Long.MAX_VALUE) fires
>> repeatedly
>> 
>> Looks good Brian.
>> 
>> +1
>> 
>> Roger
>> 
>> On 1/17/2017 3:11 PM, Brian Burkhalter wrote:
>>> 
>>> On Jan 16, 2017, at 12:12 PM, Alan Bateman <Alan.Bateman at oracle.com
>>> <mailto:Alan.Bateman at oracle.com>> wrote:
>>> 
>>>> Aside from the typo in the comment that Christophpointed then then
>>>> this looks good to me.


More information about the nio-dev mailing list