Fix libfabric transfer request lifecycle bugs (#1747)
## What? Three fixes to the libfabric backend's transfer request lifecycle (Fixes https://github.com/ai-dynamo/nixl/issues/1722) 1. releaseReqH() now deletes the nixlLibfabricBackendH handle 2. Removed dead received_remote_writes_ field and unused <unordered_set> include 3. CQ errors are now propagated to the transfer handle via the completion callback, and the failed request is released back to the pool ## Why? - Memory leak: Every postXfer() allocates a new nixlLibfabricBackendH that was never freed - Dead code: received_remote_writes_ was declared but never used in any .cpp file - CQ error hang: When fi_cq_read returned an error, the failed request was never released to the pool and the owning handle was never notified — causing transfers to hang indefinitely (and leaking pool entries) ## How? Memory leak fix: Added delete static_cast<nixlLibfabricBackendH *>(handle) in releaseReqH() CQ error propagation: Changed completion_callback signature from void() to void(nixl_status_t). On CQ error, the callback is invoked with NIXL_ERR_BACKEND — this increments the completion counter (so is_completed() eventually becomes true) and sets an error flag on the handle. On success, NIXL_SUCCESS is passed as before. checkXfer() waits for all requests to resolve before returning status. This avoids premature cancellation of in-flight requests on other rails — following the same drain-then-report pattern used by the UCX backend. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Transfer failures are now recorded and reported promptly, preventing false successes and stuck requests. * Completion errors now trigger failure notifications and reliably release affected requests. * Failed transfers no longer continue through success-only completion handling. * **API Changes** * Transfer and control-message completion callbacks now provide explicit status results. * **Chores** * Improved request cleanup and removed redundant transfer-tracking state. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Adit Ranadive <aranadive@nvidia.com>
A
Amit Radzi committed
341f87bf0f0427f2a4ca3a670a14d136aff2136d
Parent: e500c4d
Committed by GitHub <noreply@github.com>
on 8/18/2026, 8:01:42 PM