]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: server: do not report diag for peer servers with null weight
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 7 May 2021 13:13:51 +0000 (15:13 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 7 May 2021 13:20:54 +0000 (15:20 +0200)
Only check servers attached to a proxy with PR_CAP_LB.

This does not need to be backported as the diag message was added in the
current 2.4-dev branch.

src/server.c

index 9b83ff8fe96fbd63a46695142160596887554571..75977d8c77e7ec8befc55bc54a3d9a934d422ac6 100644 (file)
@@ -2703,7 +2703,7 @@ 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,
+       HA_DIAG_WARNING_COND((curproxy->cap & PR_CAP_LB) && !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);