BUG/MEDIUM: cache/cli: make "show cache" thread-safe

The "show cache" command restarts from the previous node to look for a
duplicate key, but does this after having released the lock, so under
high write load, the node has many chances of having been reassigned
and the dereference of the node crashes after a few iterations. Since
the keys are unique anyway, there's no point looking for a dup, so
let's just continue from the next value.

This is only marked as medium as it seems to have been there for a
while, and discovering it that late simply means that nobody uses that
command, thus in practice it has a very limited impact on real users.

This should be backported to all stable versions.

(cherry picked from commit da91842b6cacec8a85ac572b117c7d3562102056)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed