gpt4 book ai didi

java.lang.IllegalStateException : Request cannot be executed; I/O reactor status: STOPPED 错误

转载 作者:可可西里 更新时间:2023-11-01 15:08:38 26 4
gpt4 key购买 nike

我有一项服务预计每分钟执行约 5 个请求或更多请求。此服务依赖于 Apache AsyncHttpClient。每隔几分钟,客户端就会遇到一些导致 java.lang.IllegalStateException: Request cannot be executed; 的情况。 I/O react 器状态:STOPPED。对客户端的所有请求都以相同的异常消息开始失败。服务重启后,重复这个循环。

调试这个问题真的很难,因为请求执行失败令人惊讶地不会导致回调到 AsyncResponse 的 failed() 方法。

据我所知,已经有一个修复程序 HTTPCORE-370HttpCore NIO 中解决了 4.3.2 中的类似问题。我正在使用以下版本 -

commons-httpclient-3.1.jar
httpasyncclient-4.1.1.jar
httpcore-4.4.4.jar
httpcore-nio-4.4.4.jar

还看到这个问题。

最佳答案

我在我的应用程序中一直在处理同样的异常,我终于从这篇文章中找到了一个有用的建议 - http://httpcomponents.10934.n7.nabble.com/I-O-reactor-status-STOPPED-td29059.html

You can use #getAuditLog() method of the I/O reactor to find out exactly what exception caused it to terminate.

如果您保留对 ConnectionManager 的 IOReactor 的引用,则可以调用此方法来深入了解实际问题:

http://hc.apache.org/httpcomponents-core-4.4.x/httpcore-nio/apidocs/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.html#getAuditLog()

原来我在自己的代码中做了一些非常愚蠢的事情。但是直到我阅读审计日志我才弄明白。

关于java.lang.IllegalStateException : Request cannot be executed; I/O reactor status: STOPPED 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35350376/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com