diff --git a/src/queue.c b/src/queue.c index 5be6cdfe9..38b15429d 100644 --- a/src/queue.c +++ b/src/queue.c @@ -86,7 +86,8 @@ void process_srv_queue(struct server *s) * returned. Note that neither nor may be NULL. * Priority is given to the oldest request in the queue if both and * have pending requests. This ensures that no request will be left unserved. - * The queue is not considered if the server is not RUNNING. The + * The 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 * 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 * 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 session *sess; + struct server *rsrv; + + rsrv = srv->tracked; + if (!rsrv) + rsrv = srv; ps = pendconn_from_srv(srv); pp = pendconn_from_px(px); /* we want to get the definitive pendconn in */ - if (!pp || !(srv->state & SRV_RUNNING)) { + if (!pp || !(rsrv->state & SRV_RUNNING) || (rsrv->state & (SRV_GOINGDOWN|SRV_MAINTAIN))) { if (!ps) return NULL; } else {