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/12 09:57:19 UTC

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

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


##########
src/common/io_util.cc:
##########
@@ -151,9 +151,7 @@ Status SockConnect(const std::string &host, uint32_t port, int *fd, int conn_tim
     sin.sin_port = htons(port);
 
     fcntl(*fd, F_SETFL, O_NONBLOCK);
-    if (connect(*fd, reinterpret_cast<sockaddr *>(&sin), sizeof(sin))) {
-      return Status::FromErrno();
-    }
+    connect(*fd, reinterpret_cast<sockaddr *>(&sin), sizeof(sin));

Review Comment:
   I think maybe we can filter some specific error codes, e.g.
   ```cpp
   if (int err = connect(...); err && errno != EINPROGRESS)
   ``` 



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