From 97f1fc65cf0331a367c2075c3adf09964dda2556 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 26 Jun 2014 18:34:57 +0200 Subject: [PATCH] CLIENT KILL: don't kill the master as a normal client. Technically the problem is due to the client type API that does not return a special value for the master, however fixing it locally in the CLIENT KILL command is better currently because otherwise we would introduce a new output buffer limit class as a side effect. --- src/networking.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/networking.c b/src/networking.c index 7b6f46b3..0c276050 100644 --- a/src/networking.c +++ b/src/networking.c @@ -1410,7 +1410,9 @@ void clientCommand(redisClient *c) { while ((ln = listNext(&li)) != NULL) { client = listNodeValue(ln); if (addr && strcmp(getClientPeerId(client),addr) != 0) continue; - if (type != -1 && getClientType(client) != type) continue; + if (type != -1 && + (client->flags & REDIS_MASTER || + getClientType(client) != type)) continue; if (id != 0 && client->id != id) continue; if (c == client && skipme) continue;