Using both libc and haproxy resolvers can lead to hard to diagnose issues
when their bevahiour diverges; recommend using only one type of resolver.

Should be backported to stable versions.
---

> I think the docs could be updated to reflect this.

That's my option at least, so here is an RFC doc patch for this.

I don't know if others agree; there may be corner cases I'm not thinking
of.

---
 doc/configuration.txt | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/doc/configuration.txt b/doc/configuration.txt
index 9e4f7901ff..921504d23a 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -18242,13 +18242,19 @@ init-addr {last | libc | none | <ip>},[...]*
   instances on the fly. This option defaults to "last,libc" indicating that the
   previous address found in the state file (if any) is used first, otherwise
   the libc's resolver is used. This ensures continued compatibility with the
-  historic behavior.
+  historic behavior. When using the haproxy resolvers disabling libc based
+  resolution is recommended, also see section 5.3.
 
-  Example:
+  Example 1:
       defaults
           # never fail on address resolution
           default-server init-addr last,libc,none
 
+  Example 2:
+      defaults
+          # disable libc resolution when using resolvers
+          default-server init-addr last,none
+
 inter <delay>
 fastinter <delay>
 downinter <delay>
@@ -19281,7 +19287,8 @@ workload.
 This chapter describes how HAProxy can be configured to process server's name
 resolution at run time.
 Whether run time server name resolution has been enable or not, HAProxy will
-carry on doing the first resolution when parsing the configuration.
+keep trying to resolve names at startup during configuration parsing via libc
+for backwards compatibility.
 
 
 5.3.1. Global overview
@@ -19316,6 +19323,10 @@ A few things important to notice:
   - a resolution is considered as invalid (NX, timeout, refused), when all the
     servers return an error.
 
+  - disabling libc based initial name resolution with the "init-addr" server
+    setting is recommended to avoid using two different name resolution
+    strategies, as their behaviour will diverge.
+
 
 5.3.2. The resolvers section
 ----------------------------
-- 
2.17.1



Reply via email to