New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KQueueArrayWrapper: kqueue() failed when using Micronaut/Netty client on Mac OS X #714

Open
graemerocher opened this Issue Oct 4, 2018 · 1 comment

Comments

2 participants
@graemerocher

graemerocher commented Oct 4, 2018

NOTE: I have been unable to test RC7 due to #713

On Mac OS X a KQueueArrayWrapper: kqueue() failed error occurs threading to create the Netty thread loop group.

Using RC6 Steps to reproduce:

  1. git clone https://github.com/graemerocher/micronaut-graal-experiments.git
  2. cd micronaut-graal-experiments/app-with-discovery
  3. ./build-native-image
  4. Run the application ./app-with-discovery

On startup the following exception occurs:

io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type [io.micronaut.http.client.DefaultHttpClient]: failed to create a child event loop
	at java.lang.Throwable.<init>(Throwable.java:287)
	at java.lang.Exception.<init>(Exception.java:84)
	at java.lang.RuntimeException.<init>(RuntimeException.java:80)
	at io.micronaut.context.exceptions.BeanContextException.<init>(BeanContextException.java:32)
	at io.micronaut.context.exceptions.BeanInstantiationException.<init>(BeanInstantiationException.java:67)
	at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1291)
	at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:652)
	at io.micronaut.context.DefaultBeanContext.createBean(DefaultBeanContext.java:597)
	at io.micronaut.context.BeanContext.createBean(BeanContext.java:126)
	at io.micronaut.http.client.interceptor.HttpClientIntroductionAdvice.lambda$getClient$9(HttpClientIntroductionAdvice.java:584)
	at io.micronaut.http.client.interceptor.HttpClientIntroductionAdvice$$Lambda$1223/1685356321.apply(Unknown Source)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at io.micronaut.http.client.interceptor.HttpClientIntroductionAdvice.getClient(HttpClientIntroductionAdvice.java:555)
	at io.micronaut.http.client.interceptor.HttpClientIntroductionAdvice.intercept(HttpClientIntroductionAdvice.java:159)
	at io.micronaut.aop.MethodInterceptor.intercept(MethodInterceptor.java:41)
	at io.micronaut.aop.chain.InterceptorChain.proceed(InterceptorChain.java:147)
	at io.micronaut.discovery.consul.client.v1.AbstractConsulClient$Intercepted.register(Unknown Source)
	at io.micronaut.discovery.consul.registration.ConsulAutoRegistration.register(ConsulAutoRegistration.java:248)
	at io.micronaut.discovery.registration.AutoRegistration.onApplicationEvent(AutoRegistration.java:58)
	at io.micronaut.discovery.registration.AutoRegistration.onApplicationEvent(AutoRegistration.java:38)
	at io.micronaut.context.DefaultBeanContext.lambda$publishEvent$16(DefaultBeanContext.java:921)
	at io.micronaut.context.DefaultBeanContext$$Lambda$691/1866576445.accept(Unknown Source)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
	at io.micronaut.context.DefaultBeanContext.publishEvent(DefaultBeanContext.java:915)
	at io.micronaut.http.server.netty.NettyHttpServer.lambda$bindServerToHost$1(NettyHttpServer.java:420)
	at io.micronaut.http.server.netty.NettyHttpServer$$Lambda$1096/1135331145.accept(Unknown Source)
	at java.util.Optional.ifPresent(Optional.java:159)
	at io.micronaut.http.server.netty.NettyHttpServer.bindServerToHost(NettyHttpServer.java:418)
	at io.micronaut.http.server.netty.NettyHttpServer.start(NettyHttpServer.java:299)
	at io.micronaut.http.server.netty.NettyHttpServer.start(NettyHttpServer.java:106)
	at io.micronaut.runtime.Micronaut.lambda$start$1(Micronaut.java:73)
	at io.micronaut.runtime.Micronaut$$Lambda$661/1554191858.accept(Unknown Source)
	at java.util.Optional.ifPresent(Optional.java:159)
	at io.micronaut.runtime.Micronaut.start(Micronaut.java:71)
	at io.micronaut.runtime.Micronaut.run(Micronaut.java:271)
	at io.micronaut.runtime.Micronaut.run(Micronaut.java:257)
	at app.with.discovery.Application.main(Application.java:8)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:163)
Caused by: java.lang.IllegalStateException: failed to create a child event loop
	at java.lang.Throwable.<init>(Throwable.java:287)
	at java.lang.Exception.<init>(Exception.java:84)
	at java.lang.RuntimeException.<init>(RuntimeException.java:80)
	at java.lang.IllegalStateException.<init>(IllegalStateException.java:75)
	at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:88)
	at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58)
	at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47)
	at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:59)
	at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:77)
	at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:72)
	at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:59)
	at io.micronaut.http.client.DefaultHttpClient.createEventLoopGroup(DefaultHttpClient.java:1178)
	at io.micronaut.http.client.DefaultHttpClient.<init>(DefaultHttpClient.java:235)
	at io.micronaut.http.client.$DefaultHttpClientDefinition.doBuild(Unknown Source)
	at io.micronaut.context.AbstractParametrizedBeanDefinition.build(AbstractParametrizedBeanDefinition.java:113)
	at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1268)
	... 33 common frames omitted
Caused by: io.netty.channel.ChannelException: failed to open a new selector
	at java.lang.Throwable.<init>(Throwable.java:287)
	at java.lang.Exception.<init>(Exception.java:84)
	at java.lang.RuntimeException.<init>(RuntimeException.java:80)
	at io.netty.channel.ChannelException.<init>(ChannelException.java:35)
	at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:169)
	at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:143)
	at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:127)
	at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:36)
	at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
	... 44 common frames omitted
Caused by: java.io.IOException: KQueueArrayWrapper: kqueue() failed
	at java.lang.Throwable.<init>(Throwable.java:265)
	at java.lang.Exception.<init>(Exception.java:66)
	at java.io.IOException.<init>(IOException.java:58)
	at com.oracle.svm.core.posix.darwin.DarwinNIOSubstitutions$Target_sun_nio_ch_KQueueArrayWrapper.init(DarwinNIOSubstitutions.java:239)
	at sun.nio.ch.KQueueArrayWrapper.<init>(KQueueArrayWrapper.java:98)
	at sun.nio.ch.KQueueSelectorImpl.<init>(KQueueSelectorImpl.java:88)
	at sun.nio.ch.KQueueSelectorProvider.openSelector(KQueueSelectorProvider.java:42)
	at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:167)
	... 48 common frames omitted
@graemerocher

This comment has been minimized.

graemerocher commented Oct 5, 2018

Now that I have gotten past #713 I can confirm this issue is still present in RC7 on Mac OS X. It doesn't appear to be an issue on Linux.

@graemerocher graemerocher changed the title from 1.0.0 RC6 results in KQueueArrayWrapper: kqueue() failed when using Micronaut/Netty client to KQueueArrayWrapper: kqueue() failed when using Micronaut/Netty client on Mac OS X Oct 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment