]> git.kaiwu.me - haproxy.git/commitdiff
WIP/MEDIUM: peers: Stop to change the stksess ref_cnt when sending update messages
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 14 Oct 2025 16:49:41 +0000 (18:49 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 17 Oct 2025 14:38:53 +0000 (16:38 +0200)
src/peers.c
src/stick_table.c

index 740480b27c750a831ca575bb5825c7c2d113a740..340ba1fb38a289fa61bf065007478117f61f7de8 100644 (file)
@@ -1591,11 +1591,8 @@ int peer_send_teachmsgs(struct appctx *appctx, struct peer *p, struct shared_tab
                        applet_have_more_data(appctx);
                        ret = -1;
                }
-               else {
-                       HA_ATOMIC_INC(&ts->ref_cnt);
+               else
                        ret = peer_send_updatemsg(st, appctx, ts, st->update_id, new_pushed, use_timed);
-                       HA_ATOMIC_DEC(&ts->ref_cnt);
-               }
 
                if (ret <= 0) {
                        /* Insert <last> marker before <ts> to process it again
index 7f197478e61e06746c3e2b101205bdc40f6b5663..5e2d33b68a7cbee80c9a70038208105dfb6bbc88 100644 (file)
@@ -143,10 +143,6 @@ int __stksess_kill(struct stktable *t, struct stksess *ts)
        /* ... and that we didn't leave the update list for the tree */
        if (MT_LIST_INLIST(&ts->upd)) {
                link = mt_list_lock_full(&ts->upd);
-               if (HA_ATOMIC_LOAD(&ts->ref_cnt)) {
-                       mt_list_unlock_full(&ts->upd, link);
-                       goto out;
-               }
                mt_list_unlock_link(link);
                mt_list_unlock_self(&ts->upd);
        }
@@ -387,13 +383,8 @@ int stktable_trash_oldest(struct stktable *t)
                         * Peers will lock the element. So to the same here to avoid any conflict
                         */
                        MT_LIST_DELETE(&ts->pend_updts);
-
                        if (MT_LIST_INLIST(&ts->upd)) {
                                link = mt_list_lock_full(&ts->upd);
-                               if (HA_ATOMIC_LOAD(&ts->ref_cnt)) {
-                                       mt_list_unlock_full(&ts->upd, link);
-                                       goto requeue;
-                               }
                                mt_list_unlock_link(link);
                                mt_list_unlock_self(&ts->upd);
                        }
@@ -1006,10 +997,6 @@ struct task *process_table_expire(struct task *task, void *context, unsigned int
                        MT_LIST_DELETE(&ts->pend_updts);
                        if (MT_LIST_INLIST(&ts->upd)) {
                                link = mt_list_lock_full(&ts->upd);
-                               if (HA_ATOMIC_LOAD(&ts->ref_cnt)) {
-                                       mt_list_unlock_full(&ts->upd, link);
-                                       goto requeue;
-                               }
                                mt_list_unlock_link(link);
                                mt_list_unlock_self(&ts->upd);
                        }