Unverified Commit f560531d authored by yvette903's avatar yvette903 Committed by GitHub
Browse files

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`
parent 7f88923b
...@@ -3351,6 +3351,7 @@ void unpauseClients(void) { ...@@ -3351,6 +3351,7 @@ void unpauseClients(void) {
client *c; client *c;
server.client_pause_type = CLIENT_PAUSE_OFF; server.client_pause_type = CLIENT_PAUSE_OFF;
server.client_pause_end_time = 0;
/* Unblock all of the clients so they are reprocessed. */ /* Unblock all of the clients so they are reprocessed. */
listRewind(server.paused_clients,&li); listRewind(server.paused_clients,&li);
......
...@@ -2797,6 +2797,10 @@ void initServerConfig(void) { ...@@ -2797,6 +2797,10 @@ void initServerConfig(void) {
* Redis 5. However it is possible to revert it via redis.conf. */ * Redis 5. However it is possible to revert it via redis.conf. */
server.lua_always_replicate_commands = 1; server.lua_always_replicate_commands = 1;
/* Client Pause related */
server.client_pause_type = CLIENT_PAUSE_OFF;
server.client_pause_end_time = 0;
initConfigValues(); initConfigValues();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment