Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes the classic RDMA WorkerPool retry behavior so that when peer/local RDMA rails are temporarily unavailable (paused, endpoint missing, handshake transient failures), slices are queued for delayed redispatch with bounded wait time and backoff instead of being failed immediately. This targets link-flap recovery windows and aims to reduce reconnect/handshake pressure during rail recovery.
Changes:
- Introduces a delayed-redispatch queue with exponential backoff + jitter and a bounded give-up window.
- Replaces several immediate-failure paths in
performPostSend()/redispatch()with delayed redispatch attempts. - Adds worker-loop integration to periodically release delayed slices and optionally sleep until the next delayed slice becomes due.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| mooncake-transfer-engine/src/transport/rdma_transport/worker_pool.cpp | Implements delayed redispatch queueing, release logic, and replaces immediate failures with delayed retries across several RDMA send/redispatch paths. |
| mooncake-transfer-engine/include/transport/rdma_transport/worker_pool.h | Declares delayed redispatch helpers/state and adds rail pause remaining-time accessor. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const uint64_t now = static_cast<uint64_t>(getCurrentTimeInNano()); | ||
| if (slice->ts <= 0) slice->ts = static_cast<int64_t>(now); | ||
| const uint64_t first_wait_ns = static_cast<uint64_t>(slice->ts); | ||
| if (now > first_wait_ns && | ||
| now - first_wait_ns > delayedRedispatchMaxWaitNs()) { |
| const uint64_t next_delayed_due_ns = nextDelayedSliceDueNs(); | ||
| if (next_delayed_due_ns > 0) { | ||
| const uint64_t now = static_cast<uint64_t>(getCurrentTimeInNano()); | ||
| if (next_delayed_due_ns > now) { | ||
| const uint64_t sleep_ns = std::min(next_delayed_due_ns - now, | ||
| kDelayedRedispatchWakeCapNs); | ||
| std::this_thread::sleep_for(std::chrono::nanoseconds(sleep_ns)); | ||
| } | ||
| } |
|
Two issues remain: delayed redispatch reuses |
Description
This PR makes classic RDMA WorkerPool delay and retry redispatch when all currently usable RDMA rails are temporarily unavailable, instead of immediately failing slices.
The change covers transient peer/local rail recovery windows seen during link flap chaos testing. Slices are placed into a delayed redispatch queue with bounded wait time, exponential backoff, jitter, and awareness of existing rail pause deadlines. If rails recover, the slice is redispatched and delivery continues. If recovery never happens within the bounded wait window, the slice fails gracefully.
This also reduces reconnect/handshake pressure during recovery windows by avoiding tight 100ms retry loops.
Module
mooncake-transfer-engine)Type of Change
How Has This Been Tested?
Test commands:
Test results:
tebenchbuild passedrc=0AddressNotRegistered,corrupted size,Failed transfer detected,Data mismatch, or delayed redispatch give-up in the passing runChecklist
./scripts/code_format.shAI Assistance Disclosure
Codex helped implement and validate this targeted Transfer Engine RDMA recovery fix. The human submitter should review the changed lines before submission.