You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "linea@libero.it" <li...@libero.it> on 2003/09/12 13:40:53 UTC

Re: ConnectionTimeoutException doesn't releaseConnection()

Hi,
this is the pattern I use:

Try {
      method.execute(...);
      method.getResponseBodyAsString();
  } catch (Exception e) {
      ...
  } finally {
      method.releaseConnection();
      LOG.info("RELEASED");	
  }

The following log shows that no actual release is performed, even if the message 
"RELEASED" still appears..instead,the same pattern works for SocketTimeoutException.
Thanks again

7955   DEBUG [TimeoutCheck1] httpclient.HttpConnection - enter 
HttpConnection.readLine()
10544  DEBUG [MainCheck2] httpclient.HttpConnection - enter 
HttpConnection.isResponseAvailable(int)
10930  WARN  [MainCheck1] httpclient.HttpConnection - The host 
www.pccomputing.com:80 (or proxy nul
l:-1) did not accept the connection within timeout of 3000 milliseconds
10931  WARN  [MainCheck1] CheckPerformer - Connection Timeout occurred..
org.apache.commons.httpclient.HttpConnection$ConnectionTimeoutException
         at 
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:659)
         at 
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.o
pen(MultiThreadedHttpConnectionManager.java:957)
         at 
org.apache.commons.httpclient.HttpMethodDirector.establishValidOpenConnection(HttpMethod
Director.java:253)
         at 
org.apache.commons.httpclient.HttpMethodDirector.executeMethodForHost(HttpMethodDirector
.java:306)
         at 
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:1
43)
         at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:378)
         at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:268)
         at CheckPerformer.checkUrl(PersistenceCheck.java:557)
         at PersistenceCheck$MainCheck.run(PersistenceCheck.java:306)
10932  INFO  [MainCheck1] CheckPerformer - RELEASED

Here still no releaseConnection()




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Re: ConnectionTimeoutException doesn't releaseConnection()

Posted by Michael Becke <be...@u.washington.edu>.
It's very possible that the code in HEAD does not handle this case  
properly.  If you would open a bug in Bugzilla with this info I will  
take care of the problem this weekend.

Thanks,

Mike

On Friday, September 12, 2003, at 07:40 AM, linea@libero.it wrote:

> Hi,
> this is the pattern I use:
>
> Try {
>      method.execute(...);
>      method.getResponseBodyAsString();
>  } catch (Exception e) {
>      ...
>  } finally {
>      method.releaseConnection();
>      LOG.info("RELEASED");	
>  }
>
> The following log shows that no actual release is performed, even if  
> the message "RELEASED" still appears..instead,the same pattern works  
> for SocketTimeoutException.
> Thanks again
>
> 7955   DEBUG [TimeoutCheck1] httpclient.HttpConnection - enter  
> HttpConnection.readLine()
> 10544  DEBUG [MainCheck2] httpclient.HttpConnection - enter  
> HttpConnection.isResponseAvailable(int)
> 10930  WARN  [MainCheck1] httpclient.HttpConnection - The host  
> www.pccomputing.com:80 (or proxy nul
> l:-1) did not accept the connection within timeout of 3000 milliseconds
> 10931  WARN  [MainCheck1] CheckPerformer - Connection Timeout  
> occurred..
> org.apache.commons.httpclient.HttpConnection$ConnectionTimeoutException
>         at  
> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:6 
> 59)
>         at  
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpCo 
> nnectionAdapter.o
> pen(MultiThreadedHttpConnectionManager.java:957)
>         at  
> org.apache.commons.httpclient.HttpMethodDirector.establishValidOpenConn 
> ection(HttpMethod
> Director.java:253)
>         at  
> org.apache.commons.httpclient.HttpMethodDirector.executeMethodForHost(H 
> ttpMethodDirector
> .java:306)
>         at  
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMeth 
> odDirector.java:1
> 43)
>         at  
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java: 
> 378)
>         at  
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java: 
> 268)
>         at CheckPerformer.checkUrl(PersistenceCheck.java:557)
>         at PersistenceCheck$MainCheck.run(PersistenceCheck.java:306)
> 10932  INFO  [MainCheck1] CheckPerformer - RELEASED
>
> Here still no releaseConnection()
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:  
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:  
> commons-httpclient-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org