You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/12/09 03:07:10 UTC

[GitHub] [incubator-kvrocks] git-hulk commented on a diff in pull request #1172: Add timeout when replica connect master

git-hulk commented on code in PR #1172:
URL: https://github.com/apache/incubator-kvrocks/pull/1172#discussion_r1044051409


##########
src/cluster/replication.cc:
##########
@@ -236,18 +237,21 @@ void ReplicationThread::CallbacksStateMachine::Start() {
     handlers_.emplace_front(CallbacksStateMachine::WRITE, "auth write", authWriteCB);
   }
 
+  uint64_t connect_timestamp = 0, connect_timeout_ms = 3100;
+
   while (!repl_->stop_flag_ && bev == nullptr) {
-    Status s = Util::SockConnect(repl_->host_, repl_->port_, &cfd);
+    if (Util::GetTimeStampMS() - connect_timestamp < 1000) {

Review Comment:
   this condition should always be false? coz the connect_timestamp isn't updated at all.



-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org