]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MEDIUM] now upon startup, haproxy will warn about missing timeouts.
authorWilly Tarreau <w@1wt.eu>
Sat, 8 Jul 2006 15:28:09 +0000 (17:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 9 Jul 2006 14:22:41 +0000 (16:22 +0200)
Too many problem reports were caused by missing timeouts. While
there has never been any default value since version 1.0, having
no timeout is abnormal in networked environments, and will lead
to various problems such as CLOSE_WAIT sockets accumulating and
nasty things like this. For this reason, it's better to annoy
the users until they fix their configs than letting them run
buggy configurations.

src/cfgparse.c

index bd345b216b785eceff3716c23e2e0908174dca2f..091f6d98f48b4e661aa74bff1afb8fbfb6e81a70 100644 (file)
@@ -1873,6 +1873,15 @@ int readcfgfile(char *file)
                        }
                }
 
+               if ((curproxy->mode == PR_MODE_TCP || curproxy->mode == PR_MODE_HTTP) &&
+                   (!curproxy->clitimeout || !curproxy->contimeout || !curproxy->srvtimeout)) {
+                       Warning("parsing %s : missing timeouts for listener '%s'.\n"
+                               "   | While not properly invalid, you will certainly encounter various problems\n"
+                               "   | with such a configuration. To fix this, please ensure that all following\n"
+                               "   | values are set to a non-zero value: clitimeout, contimeout, srvtimeout.\n",
+                               file, curproxy->id);
+               }
+               
                /* first, we will invert the servers list order */
                newsrv = NULL;
                while (curproxy->srv) {