Mongodb java.lang.IllegalStateException:执行器在关闭Reactivemongo驱动程序时不接受任务

Mongodb java.lang.IllegalStateException:执行器在关闭Reactivemongo驱动程序时不接受任务,mongodb,netty,reactivemongo,Mongodb,Netty,Reactivemongo,我正在使用reactivemongo 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

我正在使用reactivemongo 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()之前,应用程序应该完成所有任务。我做错了什么,如何才能优雅地关闭驱动程序和所有连接?

这似乎是mongodb驱动程序在关闭基础EventLoop之前没有正确地等待所有任务完成

这似乎是mongodb驱动程序在关闭底层EventLoop之前没有正确地等待所有任务完成

嘿,诺曼!感谢您的回复,并为我的无知感到抱歉,我不明白您所说的“mongodb驱动程序没有正确地等待所有任务完成”是什么意思。。。我如何检查它,或者更确切地说修复它?这听起来像是mongodb驱动程序的bug。。。在所有工作完成之前,它不应该调用shutdownGracefully()。在它被调用后,它不应该尝试继续使用EventLoopGroup。我明白了。。。谢谢你的提示,我会努力联系reactivemongo社区,看看他们能说些什么。嘿,诺曼!感谢您的回复,并为我的无知感到抱歉,我不明白您所说的“mongodb驱动程序没有正确地等待所有任务完成”是什么意思。。。我如何检查它,或者更确切地说修复它?这听起来像是mongodb驱动程序的bug。。。在所有工作完成之前,它不应该调用shutdownGracefully()。在它被调用后,它不应该尝试继续使用EventLoopGroup。我明白了。。。谢谢你的提示,我会尝试联系reactivemongo社区,看看他们能说些什么。