From cd16d89ff5262023fdc7789fa73dfc8f13711d63 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 14 Oct 2025 18:49:41 +0200 Subject: [PATCH] WIP/MEDIUM: peers: Stop to change the stksess ref_cnt when sending update messages --- src/peers.c | 5 +---- src/stick_table.c | 13 ------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/peers.c b/src/peers.c index 740480b27..340ba1fb3 100644 --- a/src/peers.c +++ b/src/peers.c @@ -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 marker before to process it again diff --git a/src/stick_table.c b/src/stick_table.c index 0d18ebe04..4e3526d50 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -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); } -- 2.47.3