Skip to content

Commit af5c0f6

Browse files
committed
apply gemini-code-assist's suggestion.
1 parent 42d21ea commit af5c0f6

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

mooncake-transfer-engine/include/transport/rdma_transport/rdma_endpoint.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ class RdmaEndPoint {
126126
std::string *reply_msg = nullptr);
127127

128128
private:
129+
static constexpr uint64_t kWaitExistingHandshakeTimeoutNano =
130+
10 * 1000000000ull; // 10 seconds
131+
129132
RdmaContext &context_;
130133
std::atomic<Status> status_;
131134

mooncake-transfer-engine/src/transport/rdma_transport/rdma_endpoint.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ int RdmaEndPoint::setupConnectionsByActive() {
169169
while (status_.load(std::memory_order_acquire) == CONNECTING) {
170170
PAUSE();
171171
// Prevent infinite wait with a 10-second timeout
172-
if (getCurrentTimeInNano() - start_time > 10 * 1000000000ull) {
172+
if (getCurrentTimeInNano() - start_time >
173+
kWaitExistingHandshakeTimeoutNano) {
173174
return ERR_ENDPOINT;
174175
}
175176
}

0 commit comments

Comments
 (0)