mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 16:47:18 +02:00
[BUG] queue: don't dequeue proxy-global requests on disabled servers
If a server is disabled or tracking a disabled server, it must not dequeue requests pending in the proxy queue, it must only dequeue its own ones. The problem that was caused is that if a backend always had requests in its queue, a disabled server would continue to take traffic forever. (was commit 09d02aaf02d1f21c0c02672888f3a36a14bdd299 in 1.4)
This commit is contained in:
parent
4d179ebd21
commit
d132f746f2
10
src/queue.c
10
src/queue.c
@ -86,7 +86,8 @@ void process_srv_queue(struct server *s)
|
|||||||
* returned. Note that neither <srv> nor <px> may be NULL.
|
* returned. Note that neither <srv> nor <px> may be NULL.
|
||||||
* Priority is given to the oldest request in the queue if both <srv> and <px>
|
* Priority is given to the oldest request in the queue if both <srv> and <px>
|
||||||
* have pending requests. This ensures that no request will be left unserved.
|
* have pending requests. This ensures that no request will be left unserved.
|
||||||
* The <px> queue is not considered if the server is not RUNNING. The <srv>
|
* The <px> queue is not considered if the server (or a tracked server) is not
|
||||||
|
* RUNNING, is disabled, or has a null weight (server going down). The <srv>
|
||||||
* queue is still considered in this case, because if some connections remain
|
* queue is still considered in this case, because if some connections remain
|
||||||
* there, it means that some requests have been forced there after it was seen
|
* there, it means that some requests have been forced there after it was seen
|
||||||
* down (eg: due to option persist).
|
* down (eg: due to option persist).
|
||||||
@ -97,11 +98,16 @@ struct session *pendconn_get_next_sess(struct server *srv, struct proxy *px)
|
|||||||
{
|
{
|
||||||
struct pendconn *ps, *pp;
|
struct pendconn *ps, *pp;
|
||||||
struct session *sess;
|
struct session *sess;
|
||||||
|
struct server *rsrv;
|
||||||
|
|
||||||
|
rsrv = srv->tracked;
|
||||||
|
if (!rsrv)
|
||||||
|
rsrv = srv;
|
||||||
|
|
||||||
ps = pendconn_from_srv(srv);
|
ps = pendconn_from_srv(srv);
|
||||||
pp = pendconn_from_px(px);
|
pp = pendconn_from_px(px);
|
||||||
/* we want to get the definitive pendconn in <ps> */
|
/* we want to get the definitive pendconn in <ps> */
|
||||||
if (!pp || !(srv->state & SRV_RUNNING)) {
|
if (!pp || !(rsrv->state & SRV_RUNNING) || (rsrv->state & (SRV_GOINGDOWN|SRV_MAINTAIN))) {
|
||||||
if (!ps)
|
if (!ps)
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user