summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-03-25 12:46:59 +0100
committerantirez <antirez@gmail.com>2020-03-25 12:46:59 +0100
commitf15042dbf0f0981c827126cf70bf335e755253f0 (patch)
treed62d2f337dee1b453d11c4cad69aeb2ba8afe842
parent643bc48a00612d37a1e3efbf288cb80d7817bb2d (diff)
downloadredis-f15042dbf0f0981c827126cf70bf335e755253f0.tar.gz
Explain why we allow transactions in -BUSY state.
Related to #7022.
-rw-r--r--src/server.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/server.c b/src/server.c
index 5a54a3abb..65a01db57 100644
--- a/src/server.c
+++ b/src/server.c
@@ -3548,12 +3548,19 @@ int processCommand(client *c) {
return C_OK;
}
- /* Lua script too slow? Only allow a limited number of commands. */
+ /* Lua script too slow? Only allow a limited number of commands.
+ * Note that we need to allow the transactions commands, otherwise clients
+ * sending a transaction with pipelining without error checking, may have
+ * the MULTI plus a few initial commands refused, then the timeout
+ * condition resolves, and the bottom-half of the transaction gets
+ * executed, see Github PR #7022. */
if (server.lua_timedout &&
c->cmd->proc != authCommand &&
c->cmd->proc != helloCommand &&
c->cmd->proc != replconfCommand &&
- c->cmd->proc != multiCommand && c->cmd->proc != execCommand && c->cmd->proc != discardCommand &&
+ c->cmd->proc != multiCommand &&
+ c->cmd->proc != execCommand &&
+ c->cmd->proc != discardCommand &&
!(c->cmd->proc == shutdownCommand &&
c->argc == 2 &&
tolower(((char*)c->argv[1]->ptr)[0]) == 'n') &&