This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new dd80ec32 Fix don't duplicate killed clients which have already flagged 
kCloseAfterReply (#1020)
dd80ec32 is described below

commit dd80ec32f556950638206f5d3678a21132992558
Author: hulk <[email protected]>
AuthorDate: Fri Oct 21 11:14:11 2022 +0800

    Fix don't duplicate killed clients which have already flagged 
kCloseAfterReply (#1020)
---
 src/server/worker.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/server/worker.cc b/src/server/worker.cc
index be5bf131..c4056768 100644
--- a/src/server/worker.cc
+++ b/src/server/worker.cc
@@ -430,6 +430,10 @@ void Worker::KillClient(Redis::Connection *self, uint64_t 
id, std::string addr,
   for (const auto &iter : conns_) {
     Redis::Connection *conn = iter.second;
     if (skipme && self == conn) continue;
+    // no need to kill the client again if flags as kCloseAfterReply
+    if (conn->IsFlagEnabled(Redis::Connection::kCloseAfterReply)) {
+      continue;
+    }
     if ((type & conn->GetClientType()) || (!addr.empty() && conn->GetAddr() == 
addr) ||
         (id != 0 && conn->GetID() == id)) {
       conn->EnableFlag(Redis::Connection::kCloseAfterReply);

Reply via email to