summaryrefslogtreecommitdiff
path: root/src/blocked.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-03-27 11:13:38 +0100
committerantirez <antirez@gmail.com>2020-03-27 16:35:03 +0100
commit0e22cb2680db9f87fd232bc54419d538629edc2d (patch)
treed6cd87931eb7021f83b2c349ff98df3bc8d942e6 /src/blocked.c
parent13e4c2a9b12cbaa0361e1701926e2d398f78e6b9 (diff)
downloadredis-0e22cb2680db9f87fd232bc54419d538629edc2d.tar.gz
Precise timeouts: cleaup the table on unblock.
Now that this mechanism is the sole one used for blocked clients timeouts, it is more wise to cleanup the table when the client unblocks for any reason. We use a flag: CLIENT_IN_TO_TABLE, in order to avoid a radix tree lookup when the client was already removed from the table because we processed it by scanning the radix tree.
Diffstat (limited to 'src/blocked.c')
-rw-r--r--src/blocked.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/blocked.c b/src/blocked.c
index 443daec7f..795985ea1 100644
--- a/src/blocked.c
+++ b/src/blocked.c
@@ -186,6 +186,7 @@ void unblockClient(client *c) {
server.blocked_clients_by_type[c->btype]--;
c->flags &= ~CLIENT_BLOCKED;
c->btype = BLOCKED_NONE;
+ removeClientFromTimeoutTable(c);
queueClientForReprocessing(c);
}