summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryvette903 <49490087+yvette903@users.noreply.github.com>2021-09-09 18:44:48 +0800
committerOran Agra <oran@redislabs.com>2021-10-04 13:59:40 +0300
commit23ed37dd871432c0f4cfaa8c26bc32dff4722306 (patch)
treefc959df85006eaf73e277287f3ec37d0a311902d
parent9b25484a137368c5595fe83b4cd8f8fbf8db7092 (diff)
downloadredis-23ed37dd871432c0f4cfaa8c26bc32dff4722306.tar.gz
Fix: client pause uses an old timeout (#9477)
A write request may be paused unexpectedly because `server.client_pause_end_time` is old. **Recreate this:** redis-cli -p 6379 127.0.0.1:6379> client pause 500000000 write OK 127.0.0.1:6379> client unpause OK 127.0.0.1:6379> client pause 10000 write OK 127.0.0.1:6379> set key value The write request `set key value` is paused util the timeout of 500000000 milliseconds was reached. **Fix:** reset `server.client_pause_end_time` = 0 in `unpauseClients` (cherry picked from commit f560531d5b8a6e6d810b62114e69a5ffda7730f7)
-rw-r--r--src/networking.c1
-rw-r--r--src/server.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/networking.c b/src/networking.c
index 8a3de6e79..bf4a8daa0 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -3364,6 +3364,7 @@ void unpauseClients(void) {
client *c;
server.client_pause_type = CLIENT_PAUSE_OFF;
+ server.client_pause_end_time = 0;
/* Unblock all of the clients so they are reprocessed. */
listRewind(server.paused_clients,&li);
diff --git a/src/server.c b/src/server.c
index 8df92fd0d..58c0a3d6a 100644
--- a/src/server.c
+++ b/src/server.c
@@ -2764,6 +2764,10 @@ void initServerConfig(void) {
* Redis 5. However it is possible to revert it via redis.conf. */
server.lua_always_replicate_commands = 1;
+ /* Client Pause related */
+ server.client_pause_type = CLIENT_PAUSE_OFF;
+ server.client_pause_end_time = 0;
+
initConfigValues();
}