From: David Carlier Date: Tue, 20 Oct 2026 14:59:06 +0000 (+0100) Subject: BUG/MINOR: deviceatlas: consume a scheduled update before loading it X-Git-Tag: v3.5-dev10~52 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=0d2eccce6e7386639d6a234d0616e6d8e0ce3f96;p=haproxy.git BUG/MINOR: deviceatlas: consume a scheduled update before loading it The update flag in the shared map was only cleared after a successful reload. When the published data file could not be opened, compiled or loaded, every following request retried it: an unreadable file produced one alert per request, flooding the logs and lowering the throughput, and a file failing to compile was compiled again on each request. This is the case for example since the automatic chroot became the default, as the data file path is no longer reachable at run time. The flag is now cleared as soon as the path has been read, so a failing file is reported once and retried only when the scheduler publishes a new one. This also avoids losing an update published while the previous one was being compiled. This should be backported to lower branches. --- diff --git a/addons/deviceatlas/da.c b/addons/deviceatlas/da.c index afcf2d318..ab6d953a3 100644 --- a/addons/deviceatlas/da.c +++ b/addons/deviceatlas/da.c @@ -303,6 +303,7 @@ static void da_haproxy_checkinst(void) } #endif strlcpy2(atlasp, base + sizeof(char), sizeof(atlasp)); + base[0] = 0; jsonp = fopen(atlasp, "r"); if (jsonp == 0) { ha_alert("deviceatlas : '%s' json file has invalid path or is not readable.\n", @@ -326,7 +327,6 @@ static void da_haproxy_checkinst(void) if (nl > maxhdrlen) maxhdrlen = nl; } - base[0] = 0; #ifdef USE_THREAD HA_SPIN_UNLOCK(OTHER_LOCK, &dadwsch_lock); #endif