java.lang.IllegalStateException: исполнитель не принимает задачу при закрытии драйвера Reactivemongo - PullRequest
0 голосов
/ 18 февраля 2019

Я использую responsetivemongo 0.16.2, и каждый раз, когда я закрываю драйвер, чтобы приложение закрылось, я получаю следующую ошибку:

java.lang.IllegalStateException: executor not accepting a task
at reactivemongo.io.netty.resolver.AddressResolverGroup.getResolver(AddressResolverGroup.java:60)
at reactivemongo.io.netty.bootstrap.Bootstrap.doResolveAndConnect0(Bootstrap.java:200)
at reactivemongo.io.netty.bootstrap.Bootstrap.access$000(Bootstrap.java:49)
at reactivemongo.io.netty.bootstrap.Bootstrap$1.operationComplete(Bootstrap.java:188)
at reactivemongo.io.netty.bootstrap.Bootstrap$1.operationComplete(Bootstrap.java:174)
at reactivemongo.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at reactivemongo.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
at reactivemongo.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at reactivemongo.io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:103)
at reactivemongo.io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe.safeSetSuccess(AbstractChannel.java:978)
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:512)
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:423)
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:482)
at reactivemongo.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at reactivemongo.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at reactivemongo.io.netty.channel.kqueue.KQueueEventLoop.run(KQueueEventLoop.java:271)
at reactivemongo.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at reactivemongo.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)


22:35:22.023 [KQueueEventLoopGroup-2-1] DEBUG r.core.nodeset.ChannelFactory - [Supervisor-1/Connection-2] Connection to localhost:27017 refused for channel #c6beda17 java.lang.IllegalStateException: executor not accepting a task
at reactivemongo.io.netty.resolver.AddressResolverGroup.getResolver(AddressResolverGroup.java:60)
at reactivemongo.io.netty.bootstrap.Bootstrap.doResolveAndConnect0(Bootstrap.java:200)
at reactivemongo.io.netty.bootstrap.Bootstrap.access$000(Bootstrap.java:49)
at reactivemongo.io.netty.bootstrap.Bootstrap$1.operationComplete(Bootstrap.java:188)
at reactivemongo.io.netty.bootstrap.Bootstrap$1.operationComplete(Bootstrap.java:174)
at reactivemongo.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at reactivemongo.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
at reactivemongo.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at reactivemongo.io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:103)
at reactivemongo.io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe.safeSetSuccess(AbstractChannel.java:978)
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:512)
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:423)
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:482)
at reactivemongo.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at reactivemongo.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at reactivemongo.io.netty.channel.kqueue.KQueueEventLoop.run(KQueueEventLoop.java:271)
at reactivemongo.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at reactivemongo.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)

Я не понимаю, откуда это происходит.Прежде чем я вызову driver.close (), приложение должно завершить все задачи.Что я делаю не так и как я могу изящно закрыть драйвер и все соединения?

1 Ответ

0 голосов
/ 18 февраля 2019

Похоже, что драйвер mongodb неправильно ожидает завершения всех задач перед выключением основного EventLoop.

...