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.
This commit is contained in:
Willy Tarreau 2014-05-09 18:48:46 +02:00
parent ae30253c27
commit 67c2abc2f3

View File

@ -6950,8 +6950,22 @@ out_uri_auth_compat:
/* Check multi-process mode compatibility */ /* Check multi-process mode compatibility */
if (global.nbproc > 1) { if (global.nbproc > 1) {
if (global.stats_fe && !global.stats_fe->bind_proc) { list_for_each_entry(bind_conf, &global.stats_fe->conf.bind, by_fe) {
Warning("stats socket will not work as expected in multi-process mode (nbproc > 1), you should force process binding using 'stats bind-process'.\n"); 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");
} }
} }