WARNING: Can't invoke task later as EventLoop rejected it

929 views
Skip to first unread message

Simon Gemmell

unread,
Jun 2, 2015, 7:06:24 AM6/2/15
to ve...@googlegroups.com
Hiya, 

This code:

CompletableFuture<Void> fut = new CompletableFuture<>();
vertx.undeploy(deploymentId, (asyncResult) -> {
if (asyncResult.succeeded()) {
System.out.println(verticleName + " undeployed");
httpClient.close();
vertx.close((as) -> {
if (as.succeeded()) {
fut.complete(null);
} else {
fut.completeExceptionally(asyncResult.cause());
}
});

} else {
fut.completeExceptionally(asyncResult.cause());
}
});

Produces this exception:
io.netty.channel.AbstractChannel$AbstractUnsafe invokeLater
WARNING: Can't invoke task later as EventLoop rejected it
java.util.concurrent.RejectedExecutionException: event executor terminated
	at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:745)
	at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:322)
	at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:725)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.invokeLater(AbstractChannel.java:779)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:573)
	at io.netty.channel.nio.NioEventLoop.closeAll(NioEventLoop.java:576)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:361)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
	at java.lang.Thread.run(Thread.java:745)



Which I can see was raised before (https://github.com/vert-x3/issues/issues/9) was there a solution? Am I not supposed to vertx.close()?

Julien Viet

unread,
Jun 2, 2015, 8:06:16 AM6/2/15
to ve...@googlegroups.com, Simon Gemmell
vertx.close will take care of undeploying everything for you.

-- 
Julien Viet
www.julienviet.com
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Gemmell

unread,
Jun 2, 2015, 8:11:34 AM6/2/15
to ve...@googlegroups.com, simong...@gmail.com
Just doing:
CompletableFuture<Void> fut = new CompletableFuture<>();
vertx.close((asyncResult) -> {
if (asyncResult.succeeded()) {
fut.complete(null);
} else {
fut.completeExceptionally(asyncResult.cause());
}
});

Gives me the same exception:
io.netty.channel.AbstractChannel$AbstractUnsafe invokeLater
WARNING: Can't invoke task later as EventLoop rejected it
java.util.concurrent.RejectedExecutionException: event executor terminated
at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:745)
at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:322)
at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:725)
at io.netty.channel.AbstractChannel$AbstractUnsafe.invokeLater(AbstractChannel.java:779)
at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:573)
at io.netty.channel.nio.NioEventLoop.closeAll(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:361)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Thread.java:745)

I actually get that a bunch of times.

Julien Viet

unread,
Jun 2, 2015, 8:29:12 AM6/2/15
to ve...@googlegroups.com, Simon Gemmell, simong...@gmail.com
what version are you using ?

-- 
Julien Viet
www.julienviet.com

Simon Gemmell

unread,
Jun 3, 2015, 8:05:48 AM6/3/15
to ve...@googlegroups.com, simong...@gmail.com
M6

Julien Viet

unread,
Jun 3, 2015, 9:15:05 AM6/3/15
to ve...@googlegroups.com, Simon Gemmell, simong...@gmail.com
can you provide a reproducer please ?

-- 
Julien Viet
www.julienviet.com

Scott Rutherford

unread,
Jun 3, 2015, 9:06:02 PM6/3/15
to ve...@googlegroups.com
I see the same running the tests (still narrowing down which exact ones) in vertx-redis-client (3.0.0-SNAPSHOT) using local redis install

** Using standalone redis
Running io.vertx.test.redis.RedisClientTestBase
Starting test: RedisClientTestBase#testMulti 

Can't invoke task later as EventLoop rejected it
java.util.concurrent.RejectedExecutionException: event executor terminated
at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:745)
at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:322)
at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:725)
at io.netty.channel.AbstractChannel$AbstractUnsafe.invokeLater(AbstractChannel.java:779)
at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:573)
at io.netty.channel.nio.NioEventLoop.closeAll(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:361)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Thread.java:745)


Reply all
Reply to author
Forward
0 new messages