From 7542437a0a9d46a8e7844ebd1a0ae63aa51aff3c 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 7f197478e..5e2d33b68 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -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); }