From 077a196501e8e84cbfe5965c3bc99a173c680187 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 30 Nov 2015 12:05:59 +0100 Subject: Better SIGCHLD handling for #2897 debugging. --- src/bio.c | 1 + src/redis.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bio.c b/src/bio.c index 4bd5a17c6..66e1afd7f 100644 --- a/src/bio.c +++ b/src/bio.c @@ -152,6 +152,7 @@ void *bioProcessBackgroundJobs(void *arg) { * receive the watchdog signal. */ sigemptyset(&sigset); sigaddset(&sigset, SIGALRM); + sigaddset(&sigset, SIGCHLD); if (pthread_sigmask(SIG_BLOCK, &sigset, NULL)) redisLog(REDIS_WARNING, "Warning: can't mask SIGALRM in bio.c thread: %s", strerror(errno)); diff --git a/src/redis.c b/src/redis.c index 3afe1601d..203d8d780 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1761,7 +1761,8 @@ void initServer(void) { int j; signal(SIGHUP, SIG_IGN); - signal(SIGPIPE, SIG_IGN); + signal(SIGPIPE, SIG_IGN); /* No write(2) generated signals. */ + signal(SIGCHLD, SIG_DFL); /* We want zombies to queue for waitpid(). */ setupSignalHandlers(); if (server.syslog_enabled) { -- cgit v1.2.1