From 2738a1494177b3fdf816113c909a68a3467efcc7 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 8 Jul 2006 17:28:09 +0200 Subject: [PATCH] [MEDIUM] now upon startup, haproxy will warn about missing timeouts. 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cfgparse.c b/src/cfgparse.c index bd345b216..091f6d98f 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -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) { -- 2.47.3