]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: diag for 0 weight server
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 30 Mar 2021 08:26:27 +0000 (10:26 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 1 Apr 2021 16:03:37 +0000 (18:03 +0200)
Output a diagnostic report if a server has been configured with a null
weight.

src/server.c

index dde78e88529917d8f34e3b36c104ada3b73f3584..9043a77c2df343c01358bd8f1e82443e1a82caa4 100644 (file)
@@ -2702,6 +2702,10 @@ int parse_server(const char *file, int linenum, char **args,
        if (parse_flags & SRV_PARSE_TEMPLATE)
                _srv_parse_tmpl_init(newsrv, curproxy);
 
+       HA_DIAG_WARNING_COND(!newsrv->uweight,
+                            "parsing [%s:%d] : 'server %s' : configured with weight of 0 will never be selected by load balancing algorithms\n",
+                            file, linenum, newsrv->id);
+
        return 0;
 
  out: