Skip to content

Commit

Permalink
Update src/redis_connection.cc
Browse files Browse the repository at this point in the history
Co-authored-by: Wang Yuan <wangyuancode@163.com>
  • Loading branch information
calvinxiao and ShooterIT committed Dec 31, 2021
1 parent 9f5001f commit ee19f27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/redis_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ void Connection::ExecuteCommands(const std::vector<Redis::CommandTokens> &to_pro
(config->cluster_enabled && cmd_name == "clusterx" && cmd_tokens.size() >= 2
&& Cluster::SubCommandIsExecExclusive(cmd_tokens[1]))) {
exclusivity = svr_->WorkExclusivityGuard();

// When executing lua script commands that have "exclusive" attribute,
// we need to know current connection, but we should set current connection
// after acquiring the WorkExclusivityGuard to make it thread-safe
svr_->SetCurrentConnection(this);
} else {
concurrency = svr_->WorkConcurrencyGuard();
Expand Down

0 comments on commit ee19f27

Please sign in to comment.