BUG/MINOR: queue: properly report redistributed connections
authorWilly Tarreau <w@1wt.eu>
Wed, 21 Oct 2020 09:54:38 +0000 (11:54 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 3 Nov 2020 14:47:37 +0000 (15:47 +0100)
In commit 5cd4bbd7a ("BUG/MAJOR: threads/queue: Fix thread-safety issues
on the queues management") the counter of transferred connections was
accidently lost, so that when a server goes down with connections in its
queue, it will always be reported that 0 connection were transferred.

This should be backported as far as 1.8 since the patch above was
backported there.

(cherry picked from commit ef71f0194cfdaa9c201bece65e8c1ab3d16ed8a0)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e6985c91c3dd1100950987a5bf98eaeb863c97b8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/queue.c

index 1bb08a5..bc1ec0e 100644 (file)
@@ -418,6 +418,7 @@ int pendconn_redistribute(struct server *s)
                p->strm_flags &= ~(SF_DIRECT | SF_ASSIGNED | SF_ADDR_SET);
 
                task_wakeup(p->strm->task, TASK_WOKEN_RES);
+               xferred++;
        }
        return xferred;
 }