Remove client from list of unblocked clients when it is free'd

This commit is contained in:
Pieter Noordhuis
2011-01-17 10:03:21 +01:00
parent b8cfcea424
commit 3bcffcbe5b
4 changed files with 12 additions and 1 deletions

View File

@ -456,6 +456,13 @@ void freeClient(redisClient *c) {
ln = listSearchKey(server.clients,c);
redisAssert(ln != NULL);
listDelNode(server.clients,ln);
/* When client was just unblocked because of a blocking operation,
* remove it from the list with unblocked clients. */
if (c->flags & REDIS_UNBLOCKED) {
ln = listSearchKey(server.unblocked_clients,c);
redisAssert(ln != NULL);
listDelNode(server.unblocked_clients,ln);
}
/* Remove from the list of clients waiting for swapped keys, or ready
* to be restarted, but not yet woken up again. */
if (c->flags & REDIS_IO_WAIT) {