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.
This commit is contained in:
parent
31615e9ecf
commit
032d99e191
@ -873,6 +873,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
|
|||||||
if (server.shutdown_asap) {
|
if (server.shutdown_asap) {
|
||||||
if (prepareForShutdown(0) == REDIS_OK) exit(0);
|
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");
|
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 */
|
/* Show some info about non-empty databases */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user