You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Netty uses its GlobalEventExecutor thread and propagates into Vertx, EventLoopContext#executeFromIO does not expect such thread and fails to execute the task:
for instance:
An exception was thrown by io.vertx.core.net.impl.ChannelProvider$$Lambda$62/807291119.operationComplete()
java.lang.IllegalStateException: Uh oh! Event loop context executing with wrong thread! Expected null got Thread[globalEventExecutor-1-2,5,FailOnTimeoutGroup]
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:303)
at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:190)
at io.vertx.core.net.impl.NetClientImpl.failed(NetClientImpl.java:250)
at io.vertx.core.net.impl.NetClientImpl.lambda$connect$5(NetClientImpl.java:225)
at io.vertx.core.net.impl.ChannelProvider.lambda$connect$0(ChannelProvider.java:42)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:488)
at io.netty.util.concurrent.DefaultPromise.access$000(DefaultPromise.java:34)
at io.netty.util.concurrent.DefaultPromise$1.run(DefaultPromise.java:438)
at io.netty.util.concurrent.GlobalEventExecutor$TaskRunner.run(GlobalEventExecutor.java:233)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:745)
This can happen if the creation of a Bootstrap fails, in this case the promise is created with the GlobalEventExecutor (see AbstractBootstrap#initAndRegister())
The text was updated successfully, but these errors were encountered:
Example of issue failing the creation of a channel:
io.netty.channel.ChannelException: Unable to create Channel from class class io.netty.channel.socket.nio.NioSocketChannel
at io.netty.channel.ReflectiveChannelFactory.newChannel(ReflectiveChannelFactory.java:40)
at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:319)
at io.netty.bootstrap.Bootstrap.doResolveAndConnect(Bootstrap.java:163)
at io.netty.bootstrap.Bootstrap.connect(Bootstrap.java:145)
at io.netty.bootstrap.Bootstrap.connect(Bootstrap.java:126)
at io.vertx.core.net.impl.ChannelProvider.connect(ChannelProvider.java:37)
at io.vertx.core.net.impl.NetClientImpl.connect(NetClientImpl.java:230)
at io.vertx.core.net.impl.NetClientImpl.connect(NetClientImpl.java:97)
at io.vertx.redis.impl.RedisConnection.connect(RedisConnection.java:139)
at io.vertx.redis.impl.RedisConnection.send(RedisConnection.java:237)
at io.vertx.redis.impl.AbstractRedisClient.send(AbstractRedisClient.java:193)
at io.vertx.redis.impl.AbstractRedisClient.sendString(AbstractRedisClient.java:86)
at io.vertx.redis.impl.RedisClientImpl.ping(RedisClientImpl.java:2195)
at io.vertx.test.redis.SomeTest.lambda$doTheTest$4(SomeTest.java:55)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:324)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:440)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
at java.lang.Thread.run(Thread.java:745)
Caused by: io.netty.channel.ChannelException: Failed to open a socket.
at io.netty.channel.socket.nio.NioSocketChannel.newSocket(NioSocketChannel.java:64)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:81)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:74)
at sun.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at io.netty.channel.ReflectiveChannelFactory.newChannel(ReflectiveChannelFactory.java:38)
... 19 more
Caused by: java.net.SocketException: Too many open files in system
at sun.nio.ch.Net.socket0(Native Method)
at sun.nio.ch.Net.socket(Net.java:411)
at sun.nio.ch.Net.socket(Net.java:404)
at sun.nio.ch.SocketChannelImpl.<init>(SocketChannelImpl.java:105)
at sun.nio.ch.SelectorProviderImpl.openSocketChannel(SelectorProviderImpl.java:60)
at io.netty.channel.socket.nio.NioSocketChannel.newSocket(NioSocketChannel.java:62)
... 26 more
When Netty uses its
GlobalEventExecutor
thread and propagates into Vertx,EventLoopContext#executeFromIO
does not expect such thread and fails to execute the task:for instance:
This can happen if the creation of a
Bootstrap
fails, in this case the promise is created with theGlobalEventExecutor
(seeAbstractBootstrap#initAndRegister()
)The text was updated successfully, but these errors were encountered: