]> git.ipfire.org Git - thirdparty/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>
Tue, 21 Oct 2025 13:11:45 +0000 (15:11 +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 0d18ebe04fc60739c1c7b35ace02b06a973333d3..4e3526d50317264a5964fce72ae12270df843906 100644 (file)
@@ -145,10 +145,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);
        }
@@ -389,13 +385,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);
                        }
@@ -1051,10 +1042,6 @@ struct task *process_tables_expire(struct task *task, void *context, unsigned in
                        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);
                        }