From 2bc1527a9564cf9d7776fc817b8dc13c3e53c1b0 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 5 May 2015 16:35:44 +0200 Subject: [PATCH] processUnblockedClients: don't process clients that blocekd again --- src/blocked.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/blocked.c b/src/blocked.c index 3442b9dd..c4618a5c 100644 --- a/src/blocked.c +++ b/src/blocked.c @@ -117,9 +117,14 @@ void processUnblockedClients(void) { listDelNode(server.unblocked_clients,ln); c->flags &= ~REDIS_UNBLOCKED; - /* Process remaining data in the input buffer. */ - if (c->querybuf && sdslen(c->querybuf) > 0) { - processInputBuffer(c); + /* Process remaining data in the input buffer, unless the client + * is blocked again. Actually processInputBuffer() checks that the + * client is not blocked before to proceed, but things may change and + * the code is conceptually more correct this way. */ + if (!(c->flags & DISQUE_BLOCKED)) { + if (c->querybuf && sdslen(c->querybuf) > 0) { + processInputBuffer(c); + } } } }