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
This commit is contained in:
Willy Tarreau 2024-09-20 17:15:11 +02:00
parent 029d75df1e
commit e77c73316a

View 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);
}
}