You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.7 KiB

  1. From 036a83e9c300a42386cd378022420e52a43b314f Mon Sep 17 00:00:00 2001
  2. From: Willy Tarreau <w@1wt.eu>
  3. Date: Tue, 16 Sep 2014 15:11:04 +0200
  4. Subject: [PATCH 11/13] MEDIUM: config: only warn if stats are attached to
  5. multi-process bind directives
  6. Some users want to have a stats frontend with one line per process, but while
  7. 100% valid and safe, the config parser emits a warning. Relax this check to
  8. ensure that the warning is only emitted if at least one of the listeners is
  9. bound to multiple processes, or if the directive is placed in a backend called
  10. from multiple processes (since in this case we don't know if it's safe).
  11. (cherry picked from commit eb791e03b5c5abfddb24a439fa6434788db026b7)
  12. ---
  13. src/cfgparse.c | 15 +++++++++++++--
  14. 1 file changed, 13 insertions(+), 2 deletions(-)
  15. diff --git a/src/cfgparse.c b/src/cfgparse.c
  16. index f3907bf..5668393 100644
  17. --- a/src/cfgparse.c
  18. +++ b/src/cfgparse.c
  19. @@ -7189,8 +7189,19 @@ out_uri_auth_compat:
  20. if (nbproc > 1) {
  21. if (curproxy->uri_auth) {
  22. - Warning("Proxy '%s': in multi-process mode, stats will be limited to process assigned to the current request.\n",
  23. - curproxy->id);
  24. + int count, maxproc = 0;
  25. +
  26. + list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) {
  27. + count = popcount(bind_conf->bind_proc);
  28. + if (count > maxproc)
  29. + maxproc = count;
  30. + }
  31. + /* backends have 0, frontends have 1 or more */
  32. + if (maxproc != 1)
  33. + Warning("Proxy '%s': in multi-process mode, stats will be"
  34. + " limited to process assigned to the current request.\n",
  35. + curproxy->id);
  36. +
  37. if (!LIST_ISEMPTY(&curproxy->uri_auth->admin_rules)) {
  38. Warning("Proxy '%s': stats admin will not work correctly in multi-process mode.\n",
  39. curproxy->id);
  40. --
  41. 1.8.5.5