diff options
| author | Willy Tarreau <w@1wt.eu> | 2008-10-10 17:51:34 +0200 |
|---|---|---|
| committer | Willy Tarreau <w@1wt.eu> | 2008-10-12 22:35:26 +0200 |
| commit | d9c6ef0a4abfcb7e84e91204e8882c86cd6f68c8 (patch) | |
| tree | 93faac66268170d0c715225592f5f7558c3cd430 | |
| parent | 89e0db128c78f712592b63f8512f1cdb25708a59 (diff) | |
| download | haproxy-d9c6ef0a4abfcb7e84e91204e8882c86cd6f68c8.tar.gz | |
[BUG] do not try to pause backends during reload
During a configuration reload, haproxy tried to pause all proxies.
Unfortunately, it also tried to pause backends, which would fail
and cause trouble to the new process since the port was still bound.
| -rw-r--r-- | src/proxy.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/proxy.c b/src/proxy.c index 83ef1d599..7fe78c785 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -353,8 +353,8 @@ void soft_stop(void) tv_now(&now); /* else, the old time before select will be used */ while (p) { if (p->state != PR_STSTOPPED) { - 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); + Warning("Stopping %s %s in %d ms.\n", proxy_cap_str(p->cap), p->id, p->grace); + send_log(p, LOG_WARNING, "Stopping %s %s in %d ms.\n", proxy_cap_str(p->cap), p->id, p->grace); tv_ms_add(&p->stop_time, &now, p->grace); } p = p->next; @@ -401,16 +401,17 @@ void pause_proxies(void) p = proxy; tv_now(&now); /* else, the old time before select will be used */ while (p) { - if (p->state != PR_STERROR && + if (p->cap & PR_CAP_FE && + p->state != PR_STERROR && p->state != PR_STSTOPPED && p->state != PR_STPAUSED) { - Warning("Pausing proxy %s.\n", p->id); - send_log(p, LOG_WARNING, "Pausing proxy %s.\n", p->id); + Warning("Pausing %s %s.\n", proxy_cap_str(p->cap), p->id); + send_log(p, LOG_WARNING, "Pausing %s %s.\n", proxy_cap_str(p->cap), p->id); pause_proxy(p); if (p->state != PR_STPAUSED) { err |= 1; - Warning("Proxy %s failed to enter pause mode.\n", p->id); - send_log(p, LOG_WARNING, "Proxy %s failed to enter pause mode.\n", p->id); + Warning("%s %s failed to enter pause mode.\n", proxy_cap_str(p->cap), p->id); + send_log(p, LOG_WARNING, "%s %s failed to enter pause mode.\n", proxy_cap_str(p->cap), p->id); } } p = p->next; @@ -437,8 +438,8 @@ void listen_proxies(void) tv_now(&now); /* else, the old time before select will be used */ while (p) { if (p->state == PR_STPAUSED) { - Warning("Enabling proxy %s.\n", p->id); - send_log(p, LOG_WARNING, "Enabling proxy %s.\n", p->id); + Warning("Enabling %s %s.\n", proxy_cap_str(p->cap), p->id); + send_log(p, LOG_WARNING, "Enabling %s %s.\n", proxy_cap_str(p->cap), p->id); for (l = p->listen; l != NULL; l = l->next) { if (listen(l->fd, p->backlog ? p->backlog : p->maxconn) == 0) { @@ -456,10 +457,10 @@ void listen_proxies(void) else port = ntohs(((struct sockaddr_in *)(&l->addr))->sin_port); - Warning("Port %d busy while trying to enable proxy %s.\n", - port, p->id); - send_log(p, LOG_WARNING, "Port %d busy while trying to enable proxy %s.\n", - port, p->id); + Warning("Port %d busy while trying to enable %s %s.\n", + port, proxy_cap_str(p->cap), p->id); + send_log(p, LOG_WARNING, "Port %d busy while trying to enable %s %s.\n", + port, proxy_cap_str(p->cap), p->id); /* Another port might have been enabled. Let's stop everything. */ pause_proxy(p); break; |
