From a7da7ae8afe6e75c5dcf5262c5a1d1af2efdc39e Mon Sep 17 00:00:00 2001 From: PragmaTwice Date: Sat, 16 Nov 2024 13:19:25 +0800 Subject: [PATCH] feat(conn): avoid to check the command name directly --- src/server/redis_connection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/redis_connection.cc b/src/server/redis_connection.cc index e6bef06d59f..9b0a2becd42 100644 --- a/src/server/redis_connection.cc +++ b/src/server/redis_connection.cc @@ -413,7 +413,7 @@ void Connection::ExecuteCommands(std::deque *to_process_cmds) { // that can guarantee other threads can't come into critical zone, such as DEBUG, // CLUSTER subcommand, CONFIG SET, MULTI, LUA (in the immediate future). // Otherwise, we just use 'ConcurrencyGuard' to allow all workers to execute commands at the same time. - if (is_multi_exec && cmd_name != "exec") { + if (is_multi_exec && !(cmd_flags & kCmdEndMulti)) { // No lock guard, because 'exec' command has acquired 'WorkExclusivityGuard' } else if (cmd_flags & kCmdExclusive) { exclusivity = srv_->WorkExclusivityGuard();