JDK 9 RFR of 8165000: Selector.select(timeout) throws IOException when timeout is a large long

Langer, Christoph christoph.langer at sap.com
Thu Sep 1 07:28:08 UTC 2016


Hi Brian,

I'm wondering, if we knew that the maximum accepted value for timeout is 0x7fffffff, then we should probably cap the timeout before calling kevent?

But other than that, I also don't find any documentation about the maximum accepted timeout or why it obviously needs to be 32bit int max. That would be a question for the Apple guys, I guess.

Best regards
Christoph

> -----Original Message-----
> From: nio-dev [mailto:nio-dev-bounces at openjdk.java.net] On Behalf Of Brian
> Burkhalter
> Sent: Mittwoch, 31. August 2016 22:49
> To: nio-dev <nio-dev at openjdk.java.net>
> Subject: JDK 9 RFR of 8165000: Selector.select(timeout) throws IOException
> when timeout is a large long
> 
> Please review at your convenience.
> 
> Issue:	https://bugs.openjdk.java.net/browse/JDK-8165000
> Patch:	http://cr.openjdk.java.net/~bpb/8165000/webrev.00/
> 
> For some unknown reason Selector.open().select(timeout) fails with an
> IOException due to an EINVAL error in kevent() [1] when timeout >=
> 100000001000L. This was reported on Mac OS 10.11.6 and verified on 10.9.5. It
> occurs in both the most recent JDK 8 build and in the JDK 9 EA build. As noted in
> a comment on the issue, there are several ways to address this of which the
> above patch is one. I am not sure it is the correct path so any comments are
> welcome. It would be nice to know for example why kevent() apparently has a
> limit on the timeout size and whether this is documented anywhere. I have not
> located any such information.
> 
> Thanks,
> 
> Brian
> 
> [1]
> https://developer.apple.com/library/ios/documentation/System/Conceptual/M
> anPages_iPhoneOS/man2/kevent.2.html


More information about the nio-dev mailing list