From e77c73316a83c6bcb2bbb9bc24926075047df321 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 20 Sep 2024 17:15:11 +0200 Subject: [PATCH] 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 --- src/cfgparse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cfgparse.c b/src/cfgparse.c index 83592556f..bd7c709b5 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); } }