From 67c2abc2f37c8762dd42ea484543a60b3b2987bd Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 9 May 2014 18:48:46 +0200 Subject: [PATCH] MINOR: config: only report a warning when stats sockets are bound to more than 1 process Till now a warning was emitted if the "stats bind-process" was not specified when nbproc was greater than 1. Now we can be much finer and only emit a warning when at least of the stats socket is bound to more than one process at a time. --- src/cfgparse.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/cfgparse.c b/src/cfgparse.c index 23e2bdd18..1cdda34d1 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -6950,8 +6950,22 @@ out_uri_auth_compat: /* Check multi-process mode compatibility */ if (global.nbproc > 1) { - if (global.stats_fe && !global.stats_fe->bind_proc) { - Warning("stats socket will not work as expected in multi-process mode (nbproc > 1), you should force process binding using 'stats bind-process'.\n"); + list_for_each_entry(bind_conf, &global.stats_fe->conf.bind, by_fe) { + unsigned long mask; + + mask = nbits(global.nbproc); + if (global.stats_fe->bind_proc) + mask &= global.stats_fe->bind_proc; + + if (bind_conf->bind_proc) + mask &= bind_conf->bind_proc; + + /* stop here if more than one process is used */ + if (popcount(mask) > 1) + break; + } + if (&bind_conf->by_fe != &global.stats_fe->conf.bind) { + Warning("stats socket will not work as expected in multi-process mode (nbproc > 1), you should force process binding globally using 'stats bind-process' or per socket using the 'process' attribute.\n"); } }