From 129f27f751d56426bee664ebbcd526842f7c6e57 Mon Sep 17 00:00:00 2001 From: John Sully Date: Thu, 23 Dec 2021 02:10:20 -0500 Subject: [PATCH] Fix module test failures with blocked clients Former-commit-id: 18ec4b8600ea3462843b58a0f0e917824dfd7ff3 --- src/module.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/module.cpp b/src/module.cpp index e957e8fc2..bb0b23621 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -4291,7 +4291,14 @@ RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const ch if (!(flags & REDISMODULE_ARGV_NO_REPLICAS)) call_flags |= CMD_CALL_PROPAGATE_REPL; } + + { + aeAcquireLock(); + std::unique_lock ul(c->lock); call(c,call_flags); + aeReleaseLock(); + } + g_pserver->replication_allowed = prev_replication_allowed; serverAssert((c->flags & CLIENT_BLOCKED) == 0);