diff options
author | Ozan Tezcan <ozantezcan@gmail.com> | 2022-09-26 10:03:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 10:03:45 +0300 |
commit | 18920813a9842ec3dec895e2888d0b5d2955b916 (patch) | |
tree | c2ee24b3b400fc72051be889bf8b84d0f360b4a4 /src/module.c | |
parent | 1de675b3d52a369b88dc7a73f0bc359f7984ca44 (diff) | |
download | redis-18920813a9842ec3dec895e2888d0b5d2955b916.tar.gz |
Ignore RM_Call deny-oom flag if maxmemory is zero (#11319)
If a command gets an OOM response and then if we set maxmemory to zero
to disable the limit, server.pre_command_oom_state never gets updated
and it stays true. As RM_Call() calls with "respect deny-oom" flag checks
server.pre_command_oom_state, all calls will fail with OOM.
Added server.maxmemory check in RM_Call() to process deny-oom flag
only if maxmemory is configured.
Diffstat (limited to 'src/module.c')
-rw-r--r-- | src/module.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/module.c b/src/module.c index c3d360ec2..9e67359df 100644 --- a/src/module.c +++ b/src/module.c @@ -5903,7 +5903,7 @@ RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const ch } } - if (flags & REDISMODULE_ARGV_RESPECT_DENY_OOM) { + if (flags & REDISMODULE_ARGV_RESPECT_DENY_OOM && server.maxmemory) { if (cmd_flags & CMD_DENYOOM) { int oom_state; if (ctx->flags & REDISMODULE_CTX_THREAD_SAFE) { |