In this article
Separate posting errors, failed completions and CQ failure; retain valid work identities and remote-effect uncertainty before retrying RDMA work.
An RDMA transfer fails and the worker immediately retries the entire inference operation. Preserve the verbs evidence first. A send-posting error, an unsuccessful work completion and a completion-queue failure occur at different boundaries. Without that distinction, a retry can discard the original cause and repeat work whose remote effect is not yet understood.
Separate posting from completion
Posting a linked list of work requests can stop at an immediately detectable failure and return the failing request through bad_wr. Earlier requests in the list must not be assumed unsubmitted merely because the call reports an error. Record the list identity and failed position so recovery can reason about the prefix separately from work that was never accepted for posting.
Preserve the work identifier
Associate each request’s application meaning with its work-request identifier and queue pair. When polling completions, distinguish a polling-call failure from a returned completion whose status indicates failure. A call returning completed entries does not imply that those operations succeeded. Polling also consumes completion entries, so diagnostic code cannot assume that another consumer will later recover evidence already removed from the queue.
Read only valid error fields
The documented failed-completion contract limits valid fields to the work identifier, status, queue-pair number and vendor error. Do not interpret a byte length or other success-oriented field from an unsuccessful completion as reliable transferred payload. Preserve raw status and vendor context, then interpret vendor detail with the applicable device documentation rather than inventing a universal meaning for the number.
Inspect asynchronous queue events
A completion queue must be drained fast enough to avoid overrun. The documented overrun event makes the queue unusable, so continuing ordinary polling is not an adequate repair. Preserve asynchronous device events and their object context, and acknowledge them under the API contract. Queue health and individual operation failure need separate recovery paths even when both become one application timeout.
Define a safe retry boundary
Reconcile submitted requests, observed completions and the operation’s remote semantics before replaying useful work. A local failure does not automatically establish that no remote mutation occurred. Test error handling in an isolated harness with explicit ownership and cleanup. A useful result preserves causality and prevents ambiguous replay; it does not turn a generic retry loop into a reliable RDMA recovery protocol.
Primary references
rdma-core Send Work Request Submission.
rdma-core Completion Queue Polling.
rdma-core Asynchronous Device Events.
Related reading: RoCE vs InfiniBand for LLM serving: qualify the full fabric; vLLM tensor-parallel-size: When One Model Needs Multiple GPUs.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.