]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stick-tables: Make sure we handle expiration on all tables
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 5 Nov 2025 18:12:17 +0000 (19:12 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 5 Nov 2025 18:22:11 +0000 (19:22 +0100)
In process_tables_expire(), when parsing all the tables with expiration
set, to check if the any entry expired, make sure we start from the
oldest one, we can't just rely on eb32_first(), because of sign issues
on the timestamp.
Not doing that may mean some tables are not considered for expiration.

This does not need to be backported.

src/stick_table.c

index 9d4a75c1935a475e47c3d7d400289d1943c116a4..3f8eeb229723b862c5ec80bc491c0c150246b810 100644 (file)
@@ -986,7 +986,9 @@ struct task *process_tables_expire(struct task *task, void *context, unsigned in
                t->shards[shard].in_bucket.key = next_exp;
                eb32_insert(&ps->tables, &t->shards[shard].in_bucket);
        }
-       table_eb = eb32_first(&ps->tables);
+       table_eb = eb32_lookup_ge(&ps->tables, now_ms - TIMER_LOOK_BACK);
+       if (!table_eb)
+               table_eb = eb32_first(&ps->tables);
 
        while (table_eb) {
                struct eb32_node *tmpnode;