]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: queue: Make process_srv_queue return the number of streams
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 23 Dec 2024 14:17:25 +0000 (14:17 +0000)
committerOlivier Houchard <cognet@ci0.org>
Mon, 23 Dec 2024 14:03:40 +0000 (15:03 +0100)
Make process_srv_queue() return the number of streams unqueued, as
pendconn_grab_from_px() did, as that number is used by
srv_update_status() to generate logs.

This should be backported up to 2.6 with
111ea83ed4e13ac3ab028ed5e95201a1b4aa82b8

include/haproxy/queue.h
src/queue.c
src/server.c

index 12dde8679400db1c08cf38f6f0ba316f5bdc3931..73e6ada6bf48119adf2c89cfa6b2e729dcf36c38 100644 (file)
@@ -34,7 +34,7 @@ extern struct pool_head *pool_head_pendconn;
 
 struct pendconn *pendconn_add(struct stream *strm);
 int pendconn_dequeue(struct stream *strm);
-void process_srv_queue(struct server *s);
+int process_srv_queue(struct server *s);
 unsigned int srv_dynamic_maxconn(const struct server *s);
 int pendconn_redistribute(struct server *s);
 void pendconn_unlink(struct pendconn *p);
index 62fa7dd65256aa5284c54d02b14d8ea7df3a97c3..c2c702522ba04d5a696944854442010d75622cce 100644 (file)
@@ -354,7 +354,7 @@ static int pendconn_process_next_strm(struct server *srv, struct proxy *px, int
 /* Manages a server's connection queue. This function will try to dequeue as
  * many pending streams as possible, and wake them up.
  */
-void process_srv_queue(struct server *s)
+int process_srv_queue(struct server *s)
 {
        struct server *ref = s->track ? s->track : s;
        struct proxy  *p = s->proxy;
@@ -413,6 +413,7 @@ void process_srv_queue(struct server *s)
                if (p->lbprm.server_take_conn)
                        p->lbprm.server_take_conn(s);
        }
+       return done;
 }
 
 /* Adds the stream <strm> to the pending connection queue of server <strm>->srv
index b4f432c10c70d1aff80d54fed220c4abedf4b7c5..32b5a4c33976ec3c7b9eb6e7baeb701372d70a55 100644 (file)
@@ -6435,7 +6435,7 @@ static int _srv_update_status_op(struct server *s, enum srv_op_st_chg_cause caus
                /* check if we can handle some connections queued.
                 * We will take as many as we can handle.
                 */
-               process_srv_queue(s);
+               xferred = process_srv_queue(s);
 
                tmptrash = alloc_trash_chunk();
                if (tmptrash) {
@@ -6631,7 +6631,7 @@ static int _srv_update_status_adm(struct server *s, enum srv_adm_st_chg_cause ca
                /* check if we can handle some connections queued.
                 * We will take as many as we can handle.
                 */
-               process_srv_queue(s);
+               xferred = process_srv_queue(s);
        }
        else if (s->next_admin & SRV_ADMF_MAINT) {
                /* remaining in maintenance mode, let's inform precisely about the