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 Vjeran Marcinko <vj...@tis.hr> on 2004/11/07 19:26:24 UTC

FIN_WAIT_2 connections

Hi folks.

My customers are reporting that quite a few FIN_WAIT_2 connections are
appearing between client side using HttpClient and server app running within
Tomcat 4.1.30. Situation is not critical, but I would like to hear has any
of you there folks experienced some problems with this unwanted connection
state, and what can be the cause of this problem ?
I heard that persistent connections can be problematic, so should I include
"Connection: close" header in response of my server interface (inside Tomcat
4.1.30), thus trying to force client side (HttpClient) to work with new
connection each time when communicating ?
I'm not using HttpClient instance with multi-threaded connection manager,
but default one and I instantiate new HttpClient during each HTTP POST
request.

Regards,
Vjeran


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


Re: FIN_WAIT_2 connections

Posted by Oleg Kalnichevski <ol...@apache.org>.
> Ok, I get it now.
> But if I send "Connection: close" header during each request, that means
> connection should be closed upon each request completion, thus GC wouldn't
> need to perform closing anyway if HttpClient instance is disposed ?
>

This is correct

Oleg


> -Vjeran
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 

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


Re: FIN_WAIT_2 connections

Posted by Vjeran Marcinko <vj...@tis.hr>.
----- Original Message ----- 
From: "Oleg Kalnichevski" <ol...@apache.org>
To: "HttpClient User Discussion" <ht...@jakarta.apache.org>
Sent: Sunday, November 07, 2004 11:40 PM
Subject: Re: FIN_WAIT_2 connections


> On Sun, 2004-11-07 at 19:26, Vjeran Marcinko wrote:
>
> > I'm not using HttpClient instance with multi-threaded connection
manager,
> > but default one and I instantiate new HttpClient during each HTTP POST
> > request.
>
> Don't. Do reuse the HttpClient instance, because every time you dispose
> HttpClient instance you are very likely to dispose an open connection
> along with it. I just recently had to explain why we strongly
> recommended using HttpClient as a singleton:
>
>
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=httpclient-user@jakarta.apache.org&msgNo=23

Ok, I get it now.
But if I send "Connection: close" header during each request, that means
connection should be closed upon each request completion, thus GC wouldn't
need to perform closing anyway if HttpClient instance is disposed ?

-Vjeran


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


Re: FIN_WAIT_2 connections

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sun, 2004-11-07 at 19:26, Vjeran Marcinko wrote:

> I'm not using HttpClient instance with multi-threaded connection manager,
> but default one and I instantiate new HttpClient during each HTTP POST
> request.

Don't. Do reuse the HttpClient instance, because every time you dispose
HttpClient instance you are very likely to dispose an open connection
along with it. I just recently had to explain why we strongly
recommended using HttpClient as a singleton:

http://nagoya.apache.org/eyebrowse/ReadMsg?listName=httpclient-user@jakarta.apache.org&msgNo=23

Hope this helps

Oleg

> 
> Regards,
> Vjeran
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 


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