JDK 1.7 + Mac OS X + NIO

173 views
Skip to first unread message

Vinayak Borkar

unread,
Aug 13, 2012, 3:20:14 AM8/13/12
to hyrack...@googlegroups.com, hyrac...@googlegroups.com, asteri...@googlegroups.com
Guys,


The poll system call on Mac OS X seems to have a bug that makes the NIO
select call hang under JDK 1.7. This was leading to Hyracks' hanging
behaviour when building with JDK 1.7.

This is a known issue and there are bugs filed about this issue with
Oracle. Look at:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7159361
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7143744

I have added the required workarounds to the Hyracks build process so
that this issue does not block a build when using JDK 1.7.

If you encounter hanging of Hyracks under JDK 1.7 on Mac OS X, please
add the following Java option to the JVM:

-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.KQueueSelectorProvider


Thanks,
Vinayak

Andria Arisal

unread,
Oct 15, 2012, 12:30:37 PM10/15/12
to hyrack...@googlegroups.com, hyrac...@googlegroups.com, asteri...@googlegroups.com
Hi Vinanyak,

I am just a newbie to hyracks.

I try to compile hyracks-0.2.1 on my machine. unfortunately I face the problem with sun.nio.ch.KQueueSelectorProvider

$ mvn -v
/usr/java/latest
Apache Maven 3.0.4 (rNON-CANONICAL_2012-07-25_12-05_mockbuild; 2012-07-25 14:05:49+0200)
Maven home: /usr/share/maven
Java version: 1.7.0_07, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_07/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.6.1-1.fc17.x86_64", arch: "amd64", family: "unix"

$ cat ../hyracks-0.2.1/hyracks-ipc/target/surefire-reports/edu.uci.ics.hyracks.ipc.tests.IPCTest.txt 
-------------------------------------------------------------------------------
Test set: edu.uci.ics.hyracks.ipc.tests.IPCTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.07 sec <<< FAILURE!
test(edu.uci.ics.hyracks.ipc.tests.IPCTest)  Time elapsed: 0.019 sec  <<< ERROR!
java.util.ServiceConfigurationError
at java.nio.channels.spi.SelectorProvider.loadProviderFromProperty(SelectorProvider.java:97)
at java.nio.channels.spi.SelectorProvider.access$000(SelectorProvider.java:69)
at java.nio.channels.spi.SelectorProvider$1.run(SelectorProvider.java:171)
at java.nio.channels.spi.SelectorProvider$1.run(SelectorProvider.java:169)
at java.security.AccessController.doPrivileged(Native Method)
at java.nio.channels.spi.SelectorProvider.provider(SelectorProvider.java:168)
at java.nio.channels.Selector.open(Selector.java:227)
at edu.uci.ics.hyracks.ipc.impl.IPCConnectionManager$NetworkThread.<init>(IPCConnectionManager.java:153)
at edu.uci.ics.hyracks.ipc.impl.IPCConnectionManager.<init>(IPCConnectionManager.java:61)
at edu.uci.ics.hyracks.ipc.impl.IPCSystem.<init>(IPCSystem.java:40)
at edu.uci.ics.hyracks.ipc.tests.IPCTest.createServerIPCSystem(IPCTest.java:84)
at edu.uci.ics.hyracks.ipc.tests.IPCTest.test(IPCTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:81)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
Caused by: java.lang.ClassNotFoundException: sun.nio.ch.KQueueSelectorProvider
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.nio.channels.spi.SelectorProvider.loadProviderFromProperty(SelectorProvider.java:92)
... 39 more
 
is this issue related?

I have tried to add the same java option, but its is not working.

I can package it with java 1.6. Should I switch back to java 1.6?

Thank you for any hints.

regards,
-andria

Alexander Behm

unread,
Oct 15, 2012, 1:19:59 PM10/15/12
to andria...@gmail.com, hyrack...@googlegroups.com, hyrac...@googlegroups.com
Hi Andria,

thanks for bringing this to our attention!

Long story short, there is also a Maven bug that is preventing us from
doing the proper setup in the main pom.xml for different OS, i.e.,
having the KQueueSelectorProvider option enabled *only* for MacOS and
JDK1.7 but not for Linux with an version of the JDK.

I will forward you our internal E-Mail thread that describes the
problem, and lists a fix that you can locally apply if you prefer
using JDK1.7.

Cheers,

Alex
Reply all
Reply to author
Forward
0 new messages