Better SIGCHLD handling for #2897 debugging.

This commit is contained in:
antirez 2015-11-30 12:05:59 +01:00
parent 4f7d1e46cf
commit 077a196501
2 changed files with 3 additions and 1 deletions

View File

@ -152,6 +152,7 @@ void *bioProcessBackgroundJobs(void *arg) {
* receive the watchdog signal. */ * receive the watchdog signal. */
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGALRM); sigaddset(&sigset, SIGALRM);
sigaddset(&sigset, SIGCHLD);
if (pthread_sigmask(SIG_BLOCK, &sigset, NULL)) if (pthread_sigmask(SIG_BLOCK, &sigset, NULL))
redisLog(REDIS_WARNING, redisLog(REDIS_WARNING,
"Warning: can't mask SIGALRM in bio.c thread: %s", strerror(errno)); "Warning: can't mask SIGALRM in bio.c thread: %s", strerror(errno));

View File

@ -1761,7 +1761,8 @@ void initServer(void) {
int j; int j;
signal(SIGHUP, SIG_IGN); 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(); setupSignalHandlers();
if (server.syslog_enabled) { if (server.syslog_enabled) {