]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: stick-tables: don't leave the expire loop with elements deleted
authorWilly Tarreau <w@1wt.eu>
Wed, 3 Sep 2025 11:46:30 +0000 (11:46 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 Sep 2025 13:51:13 +0000 (15:51 +0200)
commit8da6ed6b6aecb8ef93de6d74289df5407d6d2a7d
treea58d1c4219c358aa30323852b42254053852e06d
parent554a15562f61e2a47b79df9c9970e2b4746e85f1
BUG/MEDIUM: stick-tables: don't leave the expire loop with elements deleted

In 3.2, the table expiration latency was improved by commit 994cc58576
("MEDIUM: stick-tables: Limit the number of entries we expire"), however
it introduced an issue by which it's possible to leave the loop after a
certain number of elements were expired, without requeuing the deleted
elements. The issue it causes is that other places with a non-null ref_cnt
will not necessarily delete it themselves, resulting in orphan elements in
the table. These ones will then pollute it and force recycling old ones
more often which in turn results in an increase of the contention.

Let's check for the expiration counter before deleting the element so
that it can be found upon next visit.

This fix must be backported to 3.2. It is directly related to GH
issue #3084. Thanks to Felipe and Ricardo for sharing precious info
and testing a candidate fix.
src/stick_table.c