zhixinwen commented on code in PR #3101:
URL: https://github.com/apache/kvrocks/pull/3101#discussion_r2255451404


##########
src/cluster/replication.cc:
##########
@@ -97,12 +97,17 @@ Status FeedSlaveThread::Start() {
 
 void FeedSlaveThread::Stop() {
   stop_ = true;
+  // disable read event so it would process the ack command
+  bufferevent_disable(conn_->GetBufferEvent(), EV_READ);
   warn("Slave thread was terminated, would stop feeding the slave: {}", 
conn_->GetAddr());
 }
 
 void FeedSlaveThread::Join() {
   if (auto s = util::ThreadJoin(t_); !s) {
     warn("Slave thread operation failed: {}", s.Msg());
+  } else {
+    // after the loop is finished, the connection can be freed
+    conn_.reset();

Review Comment:
   I do not find where the connection is released after `FeedSlaveThread` 
stops. Please let me know if this should not be done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to