mapleFU commented on code in PR #2461:
URL: https://github.com/apache/kvrocks/pull/2461#discussion_r1701965091


##########
src/server/worker.cc:
##########
@@ -564,6 +584,17 @@ void WorkerThread::Start() {
   LOG(INFO) << "[worker] Thread #" << t_.get_id() << " started";
 }
 
+std::map<int, redis::Connection *> Worker::GetConnections() const {
+  std::unique_lock<std::mutex> guard(conns_mu_);
+  std::map<int, redis::Connection *> result;
+  for (auto [fd, _] : conns_) {

Review Comment:
   So it's because this traversing uses legacy style traverse, which bring up 
the problem. The iter would be invalidate when erase happens?



-- 
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