]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
WIP/MEDIUM: stick-tables: Inc the session's ref_cnt when it is in the pend_updt list
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 18 Nov 2025 10:51:58 +0000 (11:51 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 18 Nov 2025 14:01:05 +0000 (15:01 +0100)
src/stick_table.c

index 5d0bd6c680d50069bf9a5b82f89d4c3a813fa4ce..10f828ecf3ee0847eda293f749ef95d38549fd76 100644 (file)
@@ -642,8 +642,10 @@ void stktable_touch_with_exp(struct stktable *t, struct stksess *ts, int local,
 
        }
 
-       if (did_append)
+       if (did_append) {
+               HA_ATOMIC_INC(&ts->ref_cnt);
                tasklet_wakeup(t->updt_task);
+       }
 
        if (decrefcnt)
                HA_ATOMIC_DEC(&ts->ref_cnt);
@@ -877,6 +879,7 @@ struct task *stktable_add_pend_updates(struct task *t, void *ctx, unsigned int s
                 * it from the list, but before we inserted it into the tree
                 */
                MT_LIST_INIT(&stksess->pend_updts);
+               HA_ATOMIC_DEC(&stksess->ref_cnt);
        }
 
        HA_RWLOCK_WRUNLOCK(STK_TABLE_UPDT_LOCK, &table->updt_lock);