You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by gd...@apache.org on 2009/10/12 16:04:16 UTC
svn commit: r824340 -
/webservices/axis2/branches/java/1_5/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
Author: gdaniels
Date: Mon Oct 12 14:04:16 2009
New Revision: 824340
URL: http://svn.apache.org/viewvc?rev=824340&view=rev
Log:
Add default 30 second timeout for HTTP connection pool starvation. Without this we can get into a situation where we lock up forever - with this we at least throw a reasonable exception after a bit.
Modified:
webservices/axis2/branches/java/1_5/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
Modified: webservices/axis2/branches/java/1_5/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?rev=824340&r1=824339&r2=824340&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_5/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java (original)
+++ webservices/axis2/branches/java/1_5/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Mon Oct 12 14:04:16 2009
@@ -50,6 +50,7 @@
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
+import org.apache.commons.httpclient.params.HttpClientParams;
import org.apache.commons.httpclient.protocol.Protocol;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -493,6 +494,10 @@
// connManager.setParams(params);
httpClient = new HttpClient(connManager);
+ HttpClientParams clientParams = new HttpClientParams();
+ // Set the default timeout in case we have a connection pool starvation to 30sec
+ clientParams.setConnectionManagerTimeout(30000);
+ httpClient.setParams(clientParams);
configContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
}