summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-01-09 20:22:20 +0200
committerGitHub <noreply@github.com>2021-01-09 10:22:20 -0800
commit430dadaf834e6de066006d5bf700d2daa70987ca (patch)
treedef7dd3d8a910bfcebfb37cf6784fa8b97a237a3
parent36f1dea5e19982fac81d44de5bb0a4febe456b06 (diff)
downloadredis-430dadaf834e6de066006d5bf700d2daa70987ca.tar.gz
CLIENT PAUSE - don't drop together with other blocked clients (#8302)
When the server state changes and blocked clients are being dropped, the paused clients should not be dropped, they're safe to keep since unlike other blocked types, these commands are not half way though processing, and the commands they sent may get rejected according to the new server state.
-rw-r--r--src/blocked.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/blocked.c b/src/blocked.c
index 250e4bd98..46935c79f 100644
--- a/src/blocked.c
+++ b/src/blocked.c
@@ -214,6 +214,13 @@ void disconnectAllBlockedClients(void) {
client *c = listNodeValue(ln);
if (c->flags & CLIENT_BLOCKED) {
+ /* PAUSED clients are an exception, when they'll be unblocked, the
+ * command processing will start from scratch, and the command will
+ * be either executed or rejected. (unlike LIST blocked clients for
+ * which the command is already in progress in a way. */
+ if (c->btype == BLOCKED_PAUSE)
+ continue;
+
addReplyError(c,
"-UNBLOCKED force unblock from blocking operation, "
"instance state changed (master -> replica?)");