BUG/MEDIUM: stick-table: use the update lock when reading tables from peers
authorWilly Tarreau <w@1wt.eu>
Tue, 2 Apr 2024 16:12:09 +0000 (18:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 Apr 2024 07:33:10 +0000 (09:33 +0200)
commited45d1332171a594f4ce7b19afc1399e889ee074
tree8c6b059afb255dab0750c7c704248a55631f776a
parent3abf6934a436a6fba14a44145c020663c81ef29d
BUG/MEDIUM: stick-table: use the update lock when reading tables from peers

In 2.9, the stick-tables' locking was split between the lock used to
manipulate the contents (->lock) and the lock used to manipulate the
list of updates and the update indexes (->updt_lock). This was done
with commit 87e072eea5 ("MEDIUM: stick-table: use a distinct lock for
the updates tree"). However a part was overlooked in the peers code,
the parts that consult (and update) the indexes use the table's lock
instead of the update lock. It's surprising that it hasn't caused more
trouble. It's likely due to the fact that the tree nodes are not often
immediately freed and that their memory area remains connected to valid
nodes in the tree during peer_stksess_lookup(), while other parts only
check or update indexes, thus are not that critical.

This needs to be backported wherever the commit above is, thus logically
2.9.
src/peers.c