From 032d99e19171bacf8c91ec47fe730b2895ec9dd4 Mon Sep 17 00:00:00 2001 From: antirez Date: Sat, 19 Jan 2013 13:19:41 +0100 Subject: [PATCH] Clear server.shutdown_asap on failed shutdown. When a SIGTERM is received Redis schedules a shutdown. However if it fails to perform the shutdown it must be clear the shutdown_asap flag otehrwise it will try again and again possibly making the server unusable. --- src/redis.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/redis.c b/src/redis.c index 9b50d9f7f..a2e0a1b13 100644 --- a/src/redis.c +++ b/src/redis.c @@ -873,6 +873,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { if (server.shutdown_asap) { if (prepareForShutdown(0) == REDIS_OK) exit(0); redisLog(REDIS_WARNING,"SIGTERM received but errors trying to shut down the server, check the logs for more information"); + server.shutdown_asap = 0; } /* Show some info about non-empty databases */