]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: config: initialize stick-tables after peers, not before
authorWilly Tarreau <w@1wt.eu>
Fri, 1 May 2015 17:09:08 +0000 (19:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 May 2015 18:16:31 +0000 (20:16 +0200)
It's dangerous to initialize stick-tables before peers because they
start a task that cannot be stopped before we know if the peers need
to be disabled and destroyed. Move this after.

src/cfgparse.c

index ce0517c6a1d2818d1c9ef3fd5e51035a3b6459c7..1470ceaf98e658784805e2007cdbf3c063b3d512 100644 (file)
@@ -7871,20 +7871,6 @@ out_uri_auth_compat:
                }
        }
 
-       /* initialize stick-tables on backend capable proxies. This must not
-        * be done earlier because the data size may be discovered while parsing
-        * other proxies.
-        */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
-               if (curproxy->state == PR_STSTOPPED)
-                       continue;
-
-               if (!stktable_init(&curproxy->table)) {
-                       Alert("Proxy '%s': failed to initialize stick-table.\n", curproxy->id);
-                       cfgerr++;
-               }
-       }
-
        /*
         * Recount currently required checks.
         */
@@ -7938,6 +7924,20 @@ out_uri_auth_compat:
                }
        }
 
+       /* initialize stick-tables on backend capable proxies. This must not
+        * be done earlier because the data size may be discovered while parsing
+        * other proxies.
+        */
+       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+               if (curproxy->state == PR_STSTOPPED)
+                       continue;
+
+               if (!stktable_init(&curproxy->table)) {
+                       Alert("Proxy '%s': failed to initialize stick-table.\n", curproxy->id);
+                       cfgerr++;
+               }
+       }
+
        if (mailers) {
                struct mailers *curmailers = mailers, **last;
                struct mailer *m, *mb;