Review Board 1.7.22


CLOUDSTACK-487 HttpClient in multithreaded environment

Review Request #8075 - Created Nov. 15, 2012 and submitted

Hiroaki Kawai
4.0 master
CLOUDSTACK-487
Reviewers
cloudstack
cloudstack-git
Running cloudstack with nicira nvp plugin, I got following error. It seems that HttpClient in servlet must use MultiThreadedHttpConnectionManager explicitly.

2012-11-14 18:21:51,576 WARN  [commons.httpclient.SimpleHttpConnectionManager] (DirectAgent-62:null) SimpleHttpConnectionManager being used incorrectly.  Be
sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time.
2012-11-14 18:21:52,017 WARN  [agent.manager.DirectAgentAttache] (DirectAgent-62:null) Seq 5-847183891: Exception Caught while executing command
java.lang.IllegalStateException: Connection is not open
        at org.apache.commons.httpclient.HttpConnection.assertOpen(HttpConnection.java:1277)
        at org.apache.commons.httpclient.HttpConnection.write(HttpConnection.java:974)
        at org.apache.commons.httpclient.HttpConnection.write(HttpConnection.java:943)
        at org.apache.commons.httpclient.HttpConnection.print(HttpConnection.java:1033)
        at org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.java:2187)
        at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2060)
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at com.cloud.network.nicira.NiciraNvpApi.executeMethod(NiciraNvpApi.java:344)
        at com.cloud.network.nicira.NiciraNvpApi.executeDeleteObject(NiciraNvpApi.java:294)
        at com.cloud.network.nicira.NiciraNvpApi.deleteLogicalSwitchPort(NiciraNvpApi.java:172)
        at com.cloud.network.resource.NiciraNvpResource.executeRequest(NiciraNvpResource.java:286)
        at com.cloud.network.resource.NiciraNvpResource.executeRequest(NiciraNvpResource.java:192)
        at com.cloud.network.resource.NiciraNvpResource.executeRequest(NiciraNvpResource.java:172)
        at com.cloud.agent.manager.DirectAgentAttache$Task.run(DirectAgentAttache.java:191)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)

 
Review request changed
Updated (Nov. 20, 2012, 1:17 a.m.)
  • changed from pending to submitted