]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: stats-file: shm-stats-file be counters not working anymore
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 15 Oct 2026 10:32:07 +0000 (12:32 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 15 Oct 2026 10:32:07 +0000 (12:32 +0200)
commit5c1a2975dfe92490f8bdfa8fb5d684af7aba0493
tree896a8a92f37928a40c37642492f27e64561b175d
parent37f3ad8aa35bb34b2363b73541780df6c7226270
BUG/MEDIUM: stats-file: shm-stats-file be counters not working anymore

As described in GH #3527, a weird behavior affects backend shared counters
where haproxy would restore stats inconsistently. In fact, the described
behavior happens because the stats file preloading mechanism is broken
for backend objects since 5495c88 ("MEDIUM: counters: Dynamically allocate
per-thread group counters") because we checked for the frontend shared map
(allocated once per process) instead of the backend one for backend
objects, and the frontend map is only allocated for frontends or hybrid
proxies, and not backends. This caused the preloading to abort.

We fix by checking the relevant backend oriented map instead. It should be
backported to 3.4.

Thanks to GH user @ssavant2 for his detailed report and patch feedback.
src/stats-file.c