hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From D H <testinganacco...@gmail.com>
Subject Re: Question on HTTPClient-675
Date Mon, 15 Jun 2009 17:39:41 GMT
Ortwin,

2009/6/15 Ortwin Gl├╝ck <odi@odi.ch>

> David,
>
> > We are still using HttpClient 3.0.1
>
> Consider upgrading.
>
Upgrading is definitely my goal, but I just started working here 3 weeks ago
and it's a large university with a lot of red tape to go through to get
something upgraded.  They want proof this will fix their problem before
upgrading.


>
> > I saw there is a bug HTTPClient-675 that was fixed by Roland Weber in
> > version 3.1.  It talks about thread-starving in the
> > MultiThreadedHttpConnectionManager and made me wonder if we were seeing
> > something similar occurring.
>
> As you are not using the MTCM, that issue does not affect you.
>
That makes sense, my thought was that maybe the condition that caused the
problem he saw would also cause our problem to happen but it looks like that
was a false hope.

> > I emailed Roland
>
> Generally you do not email indidivual developers. They might not even
> bother
> responding.
>
I was actually surprised he did reply, and was extremely polite in the email
to him, I just hadn't seen anybody else's name on the bugzilla ticket and
wasn't sure if anyone else would know the details.  I will definitely
remember that for the future.


>
> >
> >         HttpClient client = new HttpClient();
> >         PostMethod post = new PostMethod(inUrl);
> >         post.setRequestEntity(new StringRequestEntity(inPayload, null,
> > null));
> >         int statusCode = client.executeMethod(post);
> >         log.debug(new StringBuilder("inUrl=").append(inUrl).append(",
> > inPayload=")
> >                     .append(inPayload).append(", statusCode=")
> >                     .append(statusCode).toString());
> >         String payload = readPayload(post);
> >         return payload;
> >
> > The readPayload method just uses post.getResponseBodyAsStream and a
> > BufferedReader to read the response.
> > The BufferedReader is then closed in a finally block.
>
> This code does not call post.releaseConnection() at all! It will leak
> connections. It could be that you are running out of file descriptors. The
> call
> should be put into a finally block. See the example code on the website.
>
That was one of my recommendations the first day I looked at the code but
they want me to be able to duplicate the problem with my sample code first.
Hopefully your reply will help bolster the case for correcting that
oversight in their code.


>
> > Sincerely,
> > David Hamilton
>
> Hope that helps,
>
> Ortwin
>
Thank you very much for your reply and help, I appreciate it.

Sincerely,
David Hamilton

>
>
> --
> [web]  http://www.odi.ch/
> [blog] http://www.odi.ch/weblog/
> [pgp]  key 0x81CF3416
>       finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message