On Tue, 2008-01-15 at 14:48 +0100, Robert Svoboda wrote:
Hi,

I'm running HC 3.1 in threaded environment with
MultiThreadedHttpConnectionManager.

I keep getting this exception:

java.lang.IllegalStateException: Connection is not open
at 
org.apache.commons.httpclient.HttpConnection.assertOpen(HttpConnection.java:1303)
at 
org.apache.commons.httpclient.HttpConnection.isResponseAvailable(HttpConnection.java:906)
at 
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.isResponseAvailable(MultiThreadedHttpConnectionManager.java:1329)
at 
org.apache.commons.httpclient.HttpMethodBase.responseBodyConsumed(HttpMethodBase.java:2284)
at 
org.apache.commons.httpclient.HttpMethodBase$1.responseConsumed(HttpMethodBase.java:1767)
at 
org.apache.commons.httpclient.AutoCloseInputStream.notifyWatcher(AutoCloseInputStream.java:198)
at 
org.apache.commons.httpclient.AutoCloseInputStream.close(AutoCloseInputStream.java:158)
at 
org.apache.commons.httpclient.HttpMethodBase.releaseConnection(HttpMethodBase.java:1085)
at com.newstin.dc.util.HttpClientUtil.getBody(HttpClientUtil.java:110)
at com.newstin.dc.util.HttpClientUtil.getBodySilent(HttpClientUtil.java:149)
at 
com.newstin.dc.task.crawling.feedcrawler.FeedDocumentProcessor.readContent(FeedDocumentProcessor.java:128)
at 
com.newstin.dc.task.crawling.feedcrawler.FeedDocumentProcessor.processDocument(FeedDocumentProcessor.java:102)
at 
com.newstin.dc.task.crawling.feedcrawler.FeedProcessor.processDocument(FeedProcessor.java:192)
at 
com.newstin.dc.task.crawling.feedcrawler.FeedProcessor.call(FeedProcessor.java:137)
at 
com.newstin.dc.task.crawling.feedcrawler.FeedProcessor.call(FeedProcessor.java:54)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

There is a call to ensureConnectionRelease() in responseBodyConsumed() but if
this Exception happens, ensureConnectionRelease() is never called thereby
connection is never released.

This happens on only one specific site from the pool of many thousands.

What do you think?



Here's the culprit.

http://hc.apache.org/httpclient-3.x/xref/org/apache/commons/httpclient/HttpConnection.html#895

However, it is still not clear to me how come the connection has been
closed on the _client_ side before #releaseConnection. This looks fishy
to me.

Robert, could you please try to reproduce the problem with a small
(preferably self-contained) test case and run it with the context/wire
logging on?

Oleg

Regards,
Robert


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to