]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: cfgparse: warn about deprecated use of duplicate server names
authorWilly Tarreau <w@1wt.eu>
Fri, 20 Sep 2024 15:15:11 +0000 (17:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 20 Sep 2024 15:15:11 +0000 (17:15 +0200)
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

index 83592556f79d79286185a0634113ba38393fc1e1..bd7c709b5c4f9a8a8ffd7e2f2fae78c4f0fd732d 100644 (file)
@@ -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);
                        }
                }