Le Lundi 4 Janvier 2010 23:43:14, Willy Tarreau a écrit :
> Hi Cyril,
> 
> On Mon, Jan 04, 2010 at 10:21:40PM +0100, Cyril Bonté wrote:
> > Hi Willy,
> > I didn't have much time for tests but I can make some first feedbacks.
> 
> That's fortunate because I spent the day again chasing some remaining
> CLOSE_WAIT issues. I finally found horrified that the response parser
> which for a long time was the last analyser did not set a correct return
> code, making it impossible for the forwarded to see the data pass the
> first time. Also my fears on the ugly state machines were founded. I
> found several cases where they could not work. So I have reworked them
> as I initially wanted to except that this time I found how to :-)

Yes, I've seen the commit. I've had some problems with the nigthly snapshot 
that looked like this issues, so I've used a git snapshot, it looks better but 
I have some problems again.
It's not easy to reproduce, so to "facilitate", the configuration file is 
minimal (no timeout, no tuning), and maxconn 1 on the proxy as an extreme limit:

listen haproxy :8080
        mode http
        option http-server-close
        maxconn 1
        server backend 127.0.0.1:80

Then I launch this sequence :
for i in `seq 10`;
do
  echo -ne "GET / HTTP/1.1\nHost: localhost\nConnection: Keep-alive\n\n"|nc 
localhost 8080&
done
sleep 60
killall nc

Just after killing the clients (nc)
netstat -atn|grep ":8080" gives something like :
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                   
LISTEN      
tcp        0      0 127.0.0.1:8080              127.0.0.1:33442             
SYN_RECV    
tcp        0      0 127.0.0.1:8080              127.0.0.1:33439             
SYN_RECV    
tcp        0      0 127.0.0.1:33440             127.0.0.1:8080              
FIN_WAIT2   
tcp        0     56 127.0.0.1:33438             127.0.0.1:8080              
FIN_WAIT1   
tcp        0      0 127.0.0.1:8080              127.0.0.1:33437             
ESTABLISHED 
tcp        0      0 127.0.0.1:33433             127.0.0.1:8080              
TIME_WAIT   
tcp        0     56 127.0.0.1:33437             127.0.0.1:8080              
FIN_WAIT1   
tcp        0      0 127.0.0.1:8080              127.0.0.1:33438             
ESTABLISHED 
tcp       56      0 127.0.0.1:8080              127.0.0.1:33440             
CLOSE_WAIT  
tcp        0     56 127.0.0.1:33439             127.0.0.1:8080              
FIN_WAIT1   
tcp        0     56 127.0.0.1:33442             127.0.0.1:8080              
FIN_WAIT1   

OK, here begins the problem. I wait some seconds (or minutes) and then, the 
final state of the connections becomes :
netstat -atn|grep ":8080"
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                   
LISTEN
tcp        0      0 127.0.0.1:8080              127.0.0.1:33437             
ESTABLISHED
tcp        0      0 127.0.0.1:8080              127.0.0.1:33438             
ESTABLISHED
tcp       56      0 127.0.0.1:8080              127.0.0.1:33440             
CLOSE_WAIT

haproxy can't accept connections anymore.

I'll try to do more tests on this tomorrow evening.

-- 
Cyril Bonté

Reply via email to