java.lang.IllegalStateException:无法执行请求; I/O反应器状态:已停止 [英] java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED

查看:3105
本文介绍了java.lang.IllegalStateException:无法执行请求; I/O反应器状态:已停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一项服务,期望以每分钟〜5个或更多请求的速度执行请求.此服务取决于Apache AsyncHttpClient.每隔几分钟,客户端就会遇到某种导致 java.lang.IllegalStateException的情况:无法执行请求;无法执行请求. I/O反应器状态:已停止.对客户端的所有请求均以相同的异常消息开始失败.重新启动服务后,此循环重复.

I have a service that is expected to execute requests at ~5 or more requests/min. This service depends on Apache AsyncHttpClient. After every few minutes, the clients hits some condition which causes java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED. All requests to the client start failing with same exception message. After service is restarted, this cycle repeats.

真的很难调试此问题,因为请求执行失败出乎意料地不会导致回调AsyncResponse的 failed()方法.

It is really hard to debug this problem as the request execution failure surprisingly does not cause a callback to the failed() method of the AsyncResponse.

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

From what I could gather, there has been a fix HTTPCORE-370 in HttpCore NIO which solved a similar problem in 4.3.2. I am using the following version -

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

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

却看到了这个问题.

推荐答案

我一直在我的应用程序中处理这个相同的异常,最后我从这篇文章中找到了一个有用的建议-

I've been dealing with this same exception in my application, and I finally found a helpful suggestion from this post - http://httpcomponents.10934.n7.nabble.com/I-O-reactor-status-STOPPED-td29059.html

您可以使用I/O反应器的#getAuditLog()方法来准确找出 是什么异常导致其终止.

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

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

If you keep a reference to your ConnectionManager's IOReactor, you can call this method to get insight into the actual problem:

原来,我在自己的代码中做的事情非常愚蠢.但是直到阅读审核日志,我才能弄清楚.

Turns out I was doing something incredibly stupid in my own code. But I couldn't figure it out until I read the audit log.

这篇关于java.lang.IllegalStateException:无法执行请求; I/O反应器状态:已停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆