You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Dimuthu Gamage <di...@gmail.com> on 2009/06/23 06:54:36 UTC

Getting a warning after calling MultiThreadedHttpConnectionManager.shutdown()

Hi,
I'm using http-client version 3.1. I got a warning "HttpConnectionManager is
null.  Connection cannot be released." when I tried to shutdown
MultiThreadedHttpConnectionManager after doing a 'put' operation. (In fact
I'm using httpclient through abdera client, so this happens inside the
abdera client teardown() function.

When I debug I found it hits the following lines inside,
MultiThreadedHttpConnectionManager.
shutdownCheckedOutConnections(ConnectionPool connectionPool)

            connection.setHttpConnectionManager(null);
            connection.releaseConnection();

Inside the first call it set this.httpConnectionManager = null and in the
second call, it has logic similar to this,
       if (httpConnectionManager != null) {
           // some stuff
       else {
            LOG.warn("HttpConnectionManager is null.  Connection cannot be
released.");
        }

Does this do any harm to the behaviour of the shutdown operation, or should
I ignore calling it?
Is it fixed in newer versions?

I would be greatful If you can answer these problems.

--
Thanks in advance,
Dimuthu Gamage

http://www.dimuthu.org

Re: Getting a warning after calling MultiThreadedHttpConnectionManager.shutdown()

Posted by Dimuthu Gamage <di...@gmail.com>.
Hi Oleg,
Thank you for replying. I will check this with the HttpClient 4.0.

Thanks,
Dimuthu

On Wed, Jun 24, 2009 at 6:32 PM, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Tue, Jun 23, 2009 at 10:24:36AM +0530, Dimuthu Gamage wrote:
> > Hi,
> > I'm using http-client version 3.1. I got a warning "HttpConnectionManager
> is
> > null.  Connection cannot be released." when I tried to shutdown
> > MultiThreadedHttpConnectionManager after doing a 'put' operation. (In
> fact
> > I'm using httpclient through abdera client, so this happens inside the
> > abdera client teardown() function.
> >
> > When I debug I found it hits the following lines inside,
> > MultiThreadedHttpConnectionManager.
> > shutdownCheckedOutConnections(ConnectionPool connectionPool)
> >
> >             connection.setHttpConnectionManager(null);
> >             connection.releaseConnection();
> >
> > Inside the first call it set this.httpConnectionManager = null and in the
> > second call, it has logic similar to this,
> >        if (httpConnectionManager != null) {
> >            // some stuff
> >        else {
> >             LOG.warn("HttpConnectionManager is null.  Connection cannot
> be
> > released.");
> >         }
> >
> > Does this do any harm to the behaviour of the shutdown operation, or
> should
> > I ignore calling it?
>
> This seems to be harmless, however it does represent an issue with
> HttpClient
> 3.x connection management code. I would strongly recommend upgrading to
> HttpClient 4.0
>
> > Is it fixed in newer versions?
> >
>
> HttpClient 4.0 has a very different and massively better connection
> management
> code, so most likely the issue is no longer there.
>
> Oleg
>
>
>
> > I would be greatful If you can answer these problems.
> >
> > --
> > Thanks in advance,
> > Dimuthu Gamage
> >
> > http://www.dimuthu.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>


-- 
Thanks,
Dimuthu Gamage

http://www.dimuthu.org
http://www.wso2.org

Re: Getting a warning after calling MultiThreadedHttpConnectionManager.shutdown()

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, Jun 23, 2009 at 10:24:36AM +0530, Dimuthu Gamage wrote:
> Hi,
> I'm using http-client version 3.1. I got a warning "HttpConnectionManager is
> null.  Connection cannot be released." when I tried to shutdown
> MultiThreadedHttpConnectionManager after doing a 'put' operation. (In fact
> I'm using httpclient through abdera client, so this happens inside the
> abdera client teardown() function.
> 
> When I debug I found it hits the following lines inside,
> MultiThreadedHttpConnectionManager.
> shutdownCheckedOutConnections(ConnectionPool connectionPool)
> 
>             connection.setHttpConnectionManager(null);
>             connection.releaseConnection();
> 
> Inside the first call it set this.httpConnectionManager = null and in the
> second call, it has logic similar to this,
>        if (httpConnectionManager != null) {
>            // some stuff
>        else {
>             LOG.warn("HttpConnectionManager is null.  Connection cannot be
> released.");
>         }
> 
> Does this do any harm to the behaviour of the shutdown operation, or should
> I ignore calling it?

This seems to be harmless, however it does represent an issue with HttpClient
3.x connection management code. I would strongly recommend upgrading to
HttpClient 4.0

> Is it fixed in newer versions?
> 

HttpClient 4.0 has a very different and massively better connection management
code, so most likely the issue is no longer there.

Oleg



> I would be greatful If you can answer these problems.
> 
> --
> Thanks in advance,
> Dimuthu Gamage
> 
> http://www.dimuthu.org

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org