From: willy tarreau Date: Fri, 20 Jan 2006 18:46:44 +0000 (+0100) Subject: * do not respect the grace time when switching from PAUSED to STOPPED state. X-Git-Tag: v1.2.8~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=808b4e6f610ae3d747a2dde7f4aca97134dcd2db;p=thirdparty%2Fhaproxy.git * do not respect the grace time when switching from PAUSED to STOPPED state. --- diff --git a/haproxy.c b/haproxy.c index 4c734f3958..1c9dde1edf 100644 --- a/haproxy.c +++ b/haproxy.c @@ -5747,7 +5747,8 @@ static int maintain_proxies(void) { /* * this function disables health-check servers so that the process will quickly be ignored - * by load balancers. + * by load balancers. Note that if a proxy was already in the PAUSED state, then its grace + * time will not be used since it would already not listen anymore to the socket. */ static void soft_stop(void) { struct proxy *p; @@ -5756,7 +5757,7 @@ static void soft_stop(void) { p = proxy; tv_now(&now); /* else, the old time before select will be used */ while (p) { - if (p->state != PR_STSTOPPED) { + if (p->state != PR_STSTOPPED && p->state != PR_STPAUSED) { Warning("Stopping proxy %s in %d ms.\n", p->id, p->grace); send_log(p, LOG_WARNING, "Stopping proxy %s in %d ms.\n", p->id, p->grace); tv_delayfrom(&p->stop_time, &now, p->grace); @@ -5777,7 +5778,7 @@ static void pause_proxy(struct proxy *p) { /* * This function temporarily disables listening so that another new instance * can start listening. It is designed to be called upon reception of a - * SIGTTOU, after which either a SIG_USR1 can be sent to completely stop + * SIGTTOU, after which either a SIGUSR1 can be sent to completely stop * the proxy, or a SIGTTIN can be sent to listen again. */ static void pause_proxies(void) {