]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: add a diag for invalid cpu-map statement
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 15 Apr 2021 16:07:07 +0000 (18:07 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 21 Apr 2021 13:18:57 +0000 (15:18 +0200)
If a cpu-statement is refering to multiple processes and threads, it is
silently ignored. Add a diag message to report it to the user.

src/cfgparse-global.c

index 41f9daa5b6c9906375c950244bde2529ba284150..c26c086d01559cc98e853843c7d6b9617fa8d0b2 100644 (file)
@@ -1156,6 +1156,9 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
                                        }
                                }
                        }
+
+                       HA_DIAG_WARNING_COND(proc != 0x1 && thread != 0x1,
+                                            "parsing [%s:%d] : cpu-map statement is considered invalid and thus ignored as it addresses multiple processes and threads at the same time. At least one of them should be 1 and only 1.", file, linenum);
                }
 #else
                ha_alert("parsing [%s:%d] : '%s' is not enabled, please check build options for USE_CPU_AFFINITY.\n",