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.
if (!ts)
return 1;
- smp->data.u.sint = HA_ATOMIC_LOAD(&ts->ref_cnt);
+ smp->data.u.sint = HA_ATOMIC_LOAD(&ts->ref_cnt) - 1; // don't count ourselves
stktable_release(t, ts);
return 1;