DISCARD should not fail during OOM

discard command should not fail during OOM, otherwise client MULTI state
will not be cleared.
This commit is contained in:
valentino
2019-09-21 20:58:57 +03:00
parent c3899720f6
commit 7a73b7f168
2 changed files with 15 additions and 1 deletions

View File

@@ -3411,7 +3411,7 @@ int processCommand(client *c) {
* is in MULTI/EXEC context? Error. */
if (out_of_memory &&
(c->cmd->flags & CMD_DENYOOM ||
(c->flags & CLIENT_MULTI && c->cmd->proc != execCommand))) {
(c->flags & CLIENT_MULTI && c->cmd->proc != execCommand && c->cmd->proc != discardCommand))) {
flagTransaction(c);
addReply(c, shared.oomerr);
return C_OK;