]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: server/idle: at least use atomic stores when updating max_used_conns
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Nov 2022 13:32:33 +0000 (14:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 21 Nov 2022 18:21:07 +0000 (19:21 +0100)
commit9dc231a6b23fc7d5cf3c233b46e00b9e251325b4
treeefeec54c5a82e61343b33151152c6674bcea37fa
parentfdecaf6ae49b9fef923cba7c3f20d395ed6d72f2
BUG/MINOR: server/idle: at least use atomic stores when updating max_used_conns

In 2.2, some idle conns usage metrics were added by commit cf612a045
("MINOR: servers: Add a counter for the number of currently used
connections."), which mentioned that the operation doesn't need to be
atomic since we're not seeking exact values. This is true but at least
we should use atomic stores to make sure not to cause invalid values
to appear on archs that wouldn't guarantee atomicity when writing an
int, such as writing two 16-bit words. This is pretty unlikely on our
targets but better keep the code safe against this.

This may be backported as far as 2.2.
include/haproxy/server.h
src/server.c