Hi Vivek,

Le lundi 04 avril 2011 11:21:55, Vivek Malik a écrit :
> Hi,
> 
> I have been struggling with this bug for a little while and wanted to report
> it and see if you can either help me or fix this bug. Here is a sample
> config file which shows the bug
< (...)
> Basically, the config is just distributing http connections between 2
> servers based on the path. However, I am constantly seeing haproxy sending
> traffic to the wrong backend. The backend back_b in the example above is
> responsible for all pages except a few like /login, /logout, /admin, /secure
> etc.
> 
> The bug can be reproduced by
> a) User goes to home page. Haproxy forwards the request to back_b.
> b) User clicks the login link (/login which is supposed to be sent to
> back_a).
> c) User receives response from back_b instead of back_a
> 
> If the user clicks on a link quickly the request ends up going to back_b
> instead of back_a as expected based on ACL. Moreover, haproxy doesn't log
> the request and its routing to back_b. Whenever haproxy logs the request, it
> is sending to the right backend. The wrong backend logs do show them
> receiving requests from ip running haproxy. So, it has to be haproxy
> forwarding those requests.

Your sample config file uses tunnel mode, which means it can only analyze the 
first request of a connection. Everything after the headers of this first 
request is considered as data.
The issue you encounter is probably due to HTTP KeepAlive.

You should try to add "option httpclose", or better "option http-server-close" 
(which enables client HTTP keepalive and allows to analyze each request of a 
connection).
With "option http-server-close", you can also have a look at "timeout 
http-keep-alive" and "option http-pretend-keepalive".

-- 
Cyril Bonté

Reply via email to