From: Willy Tarreau Date: Fri, 20 Sep 2024 15:15:11 +0000 (+0200) Subject: MEDIUM: cfgparse: warn about deprecated use of duplicate server names X-Git-Tag: v3.1-dev9~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e77c73316a83c6bcb2bbb9bc24926075047df321;p=thirdparty%2Fhaproxy.git MEDIUM: cfgparse: warn about deprecated use of duplicate server names As discussed below, there are too many problems and limitations caused by still supporting duplicate server names. That's already particularly complicated and dissuasive to use since it requires these servers to have explicit IDs to be accept. Let's now warn on any duplicate, even with explicit IDs and remind that this will become forbidden in 3.3. Link: https://www.mail-archive.com/haproxy@formilux.org/msg45185.html --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 83592556f7..bd7c709b5c 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -3772,6 +3772,11 @@ out_uri_auth_compat: cfgerr++; break; } + + ha_warning("parsing [%s:%d] : %s '%s', another server named '%s' was already defined at line %d. This is dangerous and will not be supported anymore in version 3.3. Please use distinct names.\n", + newsrv->conf.file, newsrv->conf.line, + proxy_type_str(curproxy), curproxy->id, + newsrv->id, other_srv->conf.line); } }