]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG: queue: fix dequeueing sequence on HTTP keep-alive sessions
authorWilly Tarreau <w@1wt.eu>
Thu, 1 Mar 2012 22:34:37 +0000 (23:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 1 Mar 2012 22:49:20 +0000 (23:49 +0100)
commit2d5cd479bc7a8c1ced70e562956e3ae99fe7eec9
treeff9d705864de4df36c3c19e39760cfee905ae995
parent431946e9617572d2813bd5a8f5a51ce36f841ea3
BUG: queue: fix dequeueing sequence on HTTP keep-alive sessions

When a request completes on a server and the server connection is closed
while the client connection stays open, the HTTP engine releases all server
connection slots and scans the queues to offer the connection slot to
another pending request.

An issue happens when the released connection allows other requests to be
dequeued : may_dequeue_tasks() relies on srv->served which is only decremented
by sess_change_server() which itself is only called after may_dequeue_tasks().
This results in no connection being woken up until another connection terminates
so that may_dequeue_tasks() is called again.

This fix is minimalist and only moves sess_change_server() earlier (which is
safe). It should be reworked and the code factored out so that the same occurrence
in session.c shares the same code.

This bug has been there since the introduction of option-http-server-close and
the fix must be backported to 1.4.
src/proto_http.c