Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

CLIENT UNBLOCK

Last updated
CLIENT UNBLOCK client-id [TIMEOUT | ERROR]
Group
Connection
Arity
-3 (at least 3 words, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

CLIENT UNBLOCK ends a blocking command, such as BLPOP, BZPOPMIN or XREAD with BLOCK, that another connection is waiting in. Use it to wake a worker that you want to stop or reconfigure without waiting for its timeout.

Option Effect
client-id The id of the blocked connection, see CLIENT ID.
TIMEOUT The blocked command returns as if its timeout had expired. This is the default.
ERROR The blocked command fails with UNBLOCKED client unblocked via CLIENT UNBLOCK.
Case Reply (RESP2 and RESP3)
The connection was blocked and is now unblocked Integer 1
No such connection, or it is not blocked Integer 0
client-id is not an integer Error ERR value is not an integer or out of range
Reason is not TIMEOUT or ERROR Error ERR CLIENT UNBLOCK reason should be TIMEOUT or ERROR

In one connection:

127.0.0.1:6379> CLIENT ID
(integer) 21
127.0.0.1:6379> BLPOP jobs 0

In another:

127.0.0.1:6379> CLIENT UNBLOCK 21 ERROR
(integer) 1

The first connection then gets:

(error) UNBLOCKED client unblocked via CLIENT UNBLOCK

Same as Redis 7 and Valkey 8.

CLIENT ID, CLIENT KILL, BLPOP, blocking operations