Free protected clients asynchronously.

Related to #4840.

Note that when we re-enter the event loop with aeProcessEvents() we
don't process timers, nor before/after sleep callbacks, so we should
never end calling freeClientsInAsyncFreeQueue() when re-entering the
loop.
This commit is contained in:
antirez 2018-10-09 13:25:53 +02:00
parent 929c686cce
commit 8e2bbe9105

View File

@ -829,6 +829,13 @@ void unlinkClient(client *c) {
void freeClient(client *c) { void freeClient(client *c) {
listNode *ln; listNode *ln;
/* If a client is protected, yet we need to free it right now, make sure
* to at least use asynchronous freeing. */
if (c->flags & CLIENT_PROTECTED) {
freeClientAsync(c);
return;
}
/* If it is our master that's beging disconnected we should make sure /* If it is our master that's beging disconnected we should make sure
* to cache the state to try a partial resynchronization later. * to cache the state to try a partial resynchronization later.
* *