]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: stick-table: do not count the lookup itself in table_trackers()
authorWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 09:19:05 +0000 (11:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 14:11:24 +0000 (16:11 +0200)
commite32245e6282ba5c49adb9ee5f7d1376979fa3992
tree7a76137611dabfbee2117975a6cc8f95b9a8c814
parent9802e33a3f8555f3a6e84eed71cb43e28204b978
BUG/MINOR: stick-table: do not count the lookup itself in table_trackers()

In 1.8 when adding multi-threading support with commit 819fc6f563
("MEDIUM: threads/stick-tables: handle multithreads on stick tables"),
the entry's ref_cnt was incremented by one on all trackers and accesses,
and smp_fetch_sc_trackers() learned to return one less than the visible
value so as not to count itself in it.

One of them was missed: table_trackers() returns the number of trackers
without subtracting one so it's always one above the real value. Let's
adjust it like other places do.

This can be backported to all versions.
src/stick_table.c