Commit 7cb97aa6 authored by antirez's avatar antirez
Browse files

Move handleClientsBlockedOnKeys() outside processCommand().

In preparation for further changes. The idea is that what happens
in handleClientsBlockedOnKeys() is an "out of context" thing that
should not see server.current_client set to anything special.
parent c479eace
...@@ -1701,6 +1701,11 @@ int processCommandAndResetClient(client *c) { ...@@ -1701,6 +1701,11 @@ int processCommandAndResetClient(client *c) {
} }
if (server.current_client == NULL) deadclient = 1; if (server.current_client == NULL) deadclient = 1;
server.current_client = NULL; server.current_client = NULL;
/* Process clients blocked on keys, it is possible that the command
* we just executed made certain keys ready. */
if (listLength(server.ready_keys)) handleClientsBlockedOnKeys();
/* freeMemoryIfNeeded may flush slave output buffers. This may /* freeMemoryIfNeeded may flush slave output buffers. This may
* result into a slave, that may be the active client, to be * result into a slave, that may be the active client, to be
* freed. */ * freed. */
......
...@@ -3600,8 +3600,6 @@ int processCommand(client *c) { ...@@ -3600,8 +3600,6 @@ int processCommand(client *c) {
} else { } else {
call(c,CMD_CALL_FULL); call(c,CMD_CALL_FULL);
c->woff = server.master_repl_offset; c->woff = server.master_repl_offset;
if (listLength(server.ready_keys))
handleClientsBlockedOnKeys();
} }
return C_OK; return C_OK;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment