]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: server: Don't warn on server resolution failure with init-addr none
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 20 Jul 2023 15:25:54 +0000 (17:25 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 20 Jul 2023 16:12:44 +0000 (18:12 +0200)
During startup, when the "none" method for "init-addr" is evaluated, a
warning is emitted if a resolution failure was previously encountered. The
documentation of the "none" method states it should be used to ignore server
resolution failures and let the server starts in DOWN state. However,
because a warning may be emitted, it is not possible to start HAProxy with
"zero-warning" option.

The same is true when "-dr" command line option is used. It is counter
intuitive and, in a way, this contradict what is specified in the
documentation.

So instead, a notice message is now emitted. At the end, if "-dr" command
line option is used or if "none" method is explicitly used, it means the
admin is agree with server resolution failures. There is no reason to emit a
warning.

This patch should fix the issue #2176. It could be backported to all stable
versions but backporting to 2.8 is probably enough for now.

src/server.c

index 8ccb45be264408911947b7c3cc7c2db4dd304789..d2190de0125880ff283fc89ccea49e1954f312bd 100644 (file)
@@ -4085,8 +4085,8 @@ static int srv_iterate_initaddr(struct server *srv)
                case SRV_IADDR_NONE:
                        srv_set_admin_flag(srv, SRV_ADMF_RMAINT, SRV_ADM_STCHGC_NONE);
                        if (return_code) {
-                               ha_warning("could not resolve address '%s', disabling server.\n",
-                                          name);
+                               ha_notice("could not resolve address '%s', disabling server.\n",
+                                         name);
                        }
                        return return_code;