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:09:00 UTC

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

caipengbo commented on code in PR #1172:
URL: https://github.com/apache/incubator-kvrocks/pull/1172#discussion_r1044051983


##########
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:
   I'm terribly sorry, I forgot one line :(



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