]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: deviceatlas: ignore the scheduler's update in progress marker
authorDavid Carlier <dcarlier@deviceatlas.com>
Tue, 20 Oct 2026 14:59:04 +0000 (15:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 26 Oct 2026 10:36:26 +0000 (11:36 +0100)
The scheduler sets the first byte of the shared map to '0' while it
rewrites the data file path. Any non-zero byte was taken as a pending
update, so a request could read a partial path and emit a spurious
"invalid path" alert. '0' is now treated as no update, as the nginx
module does.

This should be backported to lower branches.

addons/deviceatlas/da.c

index ee2822aaa6fd4d6455579a5efdd080ae41a6fb2e..d1080b41408cbc76206a6628c70f064d5c15b887 100644 (file)
@@ -286,7 +286,7 @@ static void da_haproxy_checkinst(void)
             char *base;
             base = (char *)global_deviceatlas.atlasmap;
 
-            if (base[0] != 0) {
+            if (base[0] != 0 && base[0] != '0') {
             FILE *jsonp;
             void *cnew, *cold;
             da_status_t status;
@@ -297,7 +297,7 @@ static void da_haproxy_checkinst(void)
 #ifdef USE_THREAD
             if (HA_SPIN_TRYLOCK(OTHER_LOCK, &dadwsch_lock) != 0)
                 return;
-            if (base[0] == 0) {
+            if (base[0] == 0 || base[0] == '0') {
                 HA_SPIN_UNLOCK(OTHER_LOCK, &dadwsch_lock);
                 return;
             }