BUG/MINOR: stats: revert the change on ST_CONVDONE
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Feb 2021 10:49:25 +0000 (11:49 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 26 Feb 2021 15:54:29 +0000 (16:54 +0100)
commitce3ca6b309cd035fe9f41dbd87e897a5351ed4f2
tree582649f46456200ca33e5f35fe26566755d6dfa8
parent93275546cb8bb812b05768f1a1e86f0492b917c4
BUG/MINOR: stats: revert the change on ST_CONVDONE

In 2.1, commit ee4f5f83d ("MINOR: stats: get rid of the ST_CONVDONE flag")
introduced a subtle bug. By testing curproxy against defproxy in
check_config_validity(), it tried to eliminate the need for a flag
to indicate that stats authentication rules were already compiled,
but by doing so it left the issue opened for the case where a new
defaults section appears after the two proxies sharing the first
one:

      defaults
          mode http
          stats auth foo:bar

      listen l1
          bind :8080

      listen l2
          bind :8181

      defaults
          # just to break above

This config results in:
  [ALERT] 042/113725 (3121) : proxy 'f2': stats 'auth'/'realm' and 'http-request' can't be used at the same time.
  [ALERT] 042/113725 (3121) : Fatal errors found in configuration.

Removing the last defaults remains OK. It turns out that the cleanups
that followed that patch render it useless, so the best fix is to revert
the change (with the up-to-date flags instead). The flag was marked as
belonging to the config. It's not exact but it's the closest to the
reality, as it's not there to configure the behavior but ti mention
that the config parser did its job.

This could be backported as far as 2.1, but in practice it looks like
nobody ever hit it.

(cherry picked from commit 5bbc676608f654ae76c7a4cc5852a443bfe8bd41)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 6199db2715561bee77bd7c22cc144c6f44050d20)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit ef2c61682b6f8bf383f5c65a89a0e13d15f71eb3)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/types/stats.h
src/cfgparse.c