]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: external-check: don't block/unblock SIGCHLD when manipulating the list
authorWilly Tarreau <w@1wt.eu>
Tue, 21 Jun 2016 15:34:14 +0000 (17:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Jun 2016 16:10:51 +0000 (18:10 +0200)
There's no point in blocking/unblocking sigchld when removing entries
from the list since the code is called asynchronously.

Similarly the blocking/unblocking could be removed from the connect_proc_chk()
function but it happens that at high signal rates, fork() takes twice as much
time to execute as it is regularly interrupted by a signal, so in the end this
signal blocking is beneficial there for performance reasons.

src/checks.c

index b925d05613050db0081f25dd87482132d4a7313d..51864e38914eaf9f0498220084ac5f71cccecce3 100644 (file)
@@ -1552,7 +1552,6 @@ void unblock_sigchld(void)
        assert(sigprocmask(SIG_UNBLOCK, &set, NULL) == 0);
 }
 
-/* Call with SIGCHLD blocked */
 static struct pid_list *pid_list_add(pid_t pid, struct task *t)
 {
        struct pid_list *elem;
@@ -1570,7 +1569,6 @@ static struct pid_list *pid_list_add(pid_t pid, struct task *t)
        return elem;
 }
 
-/* Blocks blocks and then unblocks SIGCHLD */
 static void pid_list_del(struct pid_list *elem)
 {
        struct check *check;
@@ -1578,9 +1576,7 @@ static void pid_list_del(struct pid_list *elem)
        if (!elem)
                return;
 
-       block_sigchld();
        LIST_DEL(&elem->list);
-       unblock_sigchld();
        if (!elem->exited)
                kill(elem->pid, SIGTERM);