]> git.kaiwu.me - haproxy.git/commit
[BUG] do not dequeue the backend's pending connections on a dead server
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Dec 2008 08:33:58 +0000 (09:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Dec 2008 09:34:21 +0000 (10:34 +0100)
commit82e2f4406da7c32471fd064725236677bd52ab90
tree88e0f073bfa56d42a94a404b7f1b3855d8eedc6d
parent51256396b1c1b755aa8830f64ff160c62bb63bd0
[BUG] do not dequeue the backend's pending connections on a dead server

Kai Krueger found that previous patch was incomplete, because there is
an unconditionnal call to process_srv_queue() in session_free() which
still causes a dead server to consume pending connections from the
backend.

This call was made unconditionnal so that we don't leave unserved
connections in the server queue, for instance connections coming
in with "option persist" which can bypass the server status check.
However, the server must not touch the backend's queue if it is down.

Another fear was that some connections might remain unserved when
the server is using a dynamic maxconn if the number of connections
to the backend is too low. Right now, srv_dynamic_maxconn() ensures
this cannot happen, so the call can remain conditionnal.

The fix consists in allowing a server to process it own queue whatever
its state, but not to touch the backend's queue if it is down. Its
queue should normally be empty when the server is down because it is
redistributed when the server goes down. The only remaining cases are
precisely the persistent connections with "option persist" set, coming
in after the queue has been redispatched. Those ones must still be
processed when a connection terminates.
(cherry picked from commit cd485c44807bfcdb4928dd83c1907636b4e1b6f3)
include/proto/queue.h
src/queue.c
src/session.c