提交 1a71fb96 编写于 作者: A antirez

vm_blocked_clients count fixed in INFO, thanks to Pietern Noordhuis

上级 2cffe299
...@@ -235,19 +235,24 @@ void freeClient(redisClient *c) { ...@@ -235,19 +235,24 @@ void freeClient(redisClient *c) {
ln = listSearchKey(server.clients,c); ln = listSearchKey(server.clients,c);
redisAssert(ln != NULL); redisAssert(ln != NULL);
listDelNode(server.clients,ln); listDelNode(server.clients,ln);
/* Remove from the list of clients that are now ready to be restarted /* Remove from the list of clients waiting for swapped keys, or ready
* after waiting for swapped keys */ * to be restarted, but not yet woken up again. */
if (c->flags & REDIS_IO_WAIT && listLength(c->io_keys) == 0) { if (c->flags & REDIS_IO_WAIT) {
ln = listSearchKey(server.io_ready_clients,c); redisAssert(server.vm_enabled);
if (ln) { if (listLength(c->io_keys) == 0) {
ln = listSearchKey(server.io_ready_clients,c);
/* When this client is waiting to be woken up (REDIS_IO_WAIT),
* it should be present in the list io_ready_clients */
redisAssert(ln != NULL);
listDelNode(server.io_ready_clients,ln); listDelNode(server.io_ready_clients,ln);
server.vm_blocked_clients--; } else {
while (listLength(c->io_keys)) {
ln = listFirst(c->io_keys);
dontWaitForSwappedKey(c,ln->value);
}
} }
} server.vm_blocked_clients--;
/* Remove from the list of clients waiting for swapped keys */
while (server.vm_enabled && listLength(c->io_keys)) {
ln = listFirst(c->io_keys);
dontWaitForSwappedKey(c,ln->value);
} }
listRelease(c->io_keys); listRelease(c->io_keys);
/* Master/slave cleanup */ /* Master/slave cleanup */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册