JDK 9 RFR of 8165000: Selector.select(timeout) throws IOException when timeout is a large long
Brian Burkhalter
brian.burkhalter at oracle.com
Wed Aug 31 20:49:02 UTC 2016
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/ManPages_iPhoneOS/man2/kevent.2.html
More information about the nio-dev
mailing list