Re: avoiding CLOSE_WAIT on client side after client/server timeout

From: Willy Tarreau <w#1wt.eu>
Date: Sat, 8 Oct 2011 09:16:18 +0200


Hi Alex,

On Sun, Oct 02, 2011 at 06:48:08PM +0200, Piavlo wrote:
>
> Hi,
>
> I noticed that both for tcp and http connections then client/server
> timeout is reached and haproxy tears the connection - the client side
> socket is CLOSE_WAIT.
> Is there a clean way to make haproxy tear the connection to the client.

A CLOSE_WAIT on a machine means that a FIN was received from the remote end on the TCP connection and that it was not yet processed by the application (haproxy if you're seeing this on this machine).

The only situation I see where you can have CLOSE_WAIT sockets is when a client actively disconnects from haproxy before getting a response. Haproxy will then wait for the response (or timeout) to come and send it to the client. During this time, the connection is in CLOSE_WAIT.

I don't know if this is what you observed, but you should never have this when haproxy detects a timeout, because its closes the connection itself, so by definition it cannot be in CLOSE_WAIT.

Regards,
Willy Received on 2011/10/08 09:16

This archive was generated by hypermail 2.2.0 : 2011/10/08 09:30 CEST