mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-27 17:16:45 -04:00
[BUG] proxy: peers must only be stopped once, not upon every call to maintain_proxies
Peers were stopped on every call to maintain_proxies when stopping=1, while they should only be stopped once upon call to soft_stop(). This bug has little impact, mostly increased CPU usage. It's not needed to backport it.
This commit is contained in:
parent
b32907b6c7
commit
bbe11b1e3c
1 changed files with 7 additions and 9 deletions
16
src/proxy.c
16
src/proxy.c
|
|
@ -518,8 +518,6 @@ void maintain_proxies(int *next)
|
|||
}
|
||||
|
||||
if (stopping) {
|
||||
struct peers *prs;
|
||||
|
||||
p = proxy;
|
||||
while (p) {
|
||||
if (p->state != PR_STSTOPPED) {
|
||||
|
|
@ -540,13 +538,6 @@ void maintain_proxies(int *next)
|
|||
}
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
prs = peers;
|
||||
while (prs) {
|
||||
stop_proxy((struct proxy *)prs->peers_fe);
|
||||
prs = prs->next;
|
||||
}
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -560,6 +551,7 @@ void maintain_proxies(int *next)
|
|||
void soft_stop(void)
|
||||
{
|
||||
struct proxy *p;
|
||||
struct peers *prs;
|
||||
|
||||
stopping = 1;
|
||||
p = proxy;
|
||||
|
|
@ -575,6 +567,12 @@ void soft_stop(void)
|
|||
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
prs = peers;
|
||||
while (prs) {
|
||||
stop_proxy((struct proxy *)prs->peers_fe);
|
||||
prs = prs->next;
|
||||
}
|
||||
/* signal zero is used to broadcast the "stopping" event */
|
||||
signal_handler(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue