diff --git a/paddle/pserver/LightNetwork.cpp b/paddle/pserver/LightNetwork.cpp index 61bd6d358dec650534ce4a5bb8e4ec6cb9f111b9..922f25734dee0a6db7fbcfcef3d29d2bad5b7858 100644 --- a/paddle/pserver/LightNetwork.cpp +++ b/paddle/pserver/LightNetwork.cpp @@ -383,7 +383,7 @@ void SocketClient::TcpClient(const std::string &serverAddr, int serverPort) { setOption(sockfd); /// Now connect to the server - int retry_second = 0; + int retry_count = 0; do { if (connect(sockfd, (sockaddr *)&serv_addr, sizeof(serv_addr)) == 0) { break; @@ -391,7 +391,7 @@ void SocketClient::TcpClient(const std::string &serverAddr, int serverPort) { if (errno == ECONNREFUSED) { LOG(WARNING) << "connection refused by pserver, try again!"; - if (retry_second++ >= 7) { + if (retry_count++ >= 7) { LOG(FATAL) << "connection refused by pserver, maybe pserver failed!"; } std::this_thread::sleep_for(std::chrono::seconds(1));