Skip to content

[release/1.5.2] libfabric: serialize all endpoint/CQ/AV calls with the rail EP lock - #2542

Merged
nv-nmailhot merged 1 commit into
release/1.5.2from
nmailhot/1.5.2-cp-2308
Oct 28, 2026
Merged

nv-nmailhot merged 1 commit into
release/1.5.2from
nmailhot/1.5.2-cp-2308

Conversation

@nv-nmailhot

Copy link
Copy Markdown
Contributor

What?

Cherry-pick of #2308 (2c1f6eff): serialize all endpoint/CQ/AV calls with the rail EP lock in the libfabric backend.

Why?

Listed as pending for 1.5.2. Already on main and release/1.6.0; applies cleanly on top of the #2494 cherry-pick (both touch libfabric_rail.cpp).

🤖 Generated with Claude Code

…2308)

## What?
Hold the rail's `ep_mutex_` around every libfabric call on its endpoint,
CQ and AV, including the progress-thread (PT) paths `drainPostQueue()`
and `pollForCompletions()`, which bypassed it. Also lock AV
insert/remove and endpoint-bound MR bind/enable/close.

## Why?
Rails use `FI_THREAD_COMPLETION`, so the application must serialize
endpoint and CQ access. With the PT enabled, the PT posts transfers and
reads the CQ while the caller's thread posts control messages on rail 0
(`postSend()`, which took the lock). On libfabric 2.7.x (EFA RDM path)
this race corrupts provider state and hangs nixlbench --enable-pt
VRAM-initiator WRITE.

## How?
Lock only the `fi_*` call itself, never an `FI_EAGAIN` retry loop, and
run completion handling and callbacks outside the lock.

Signed-off-by: Rongbing Zhou <rongbiz@amazon.com>
(cherry picked from commit 2c1f6ef)
@github-actions

Copy link
Copy Markdown

👋 Hi nv-nmailhot! Thank you for contributing to ai-dynamo/nixl.

Your PR reviewers will review your contribution then trigger the CI to test your changes.

🚀

@nv-nmailhot
nv-nmailhot merged commit b6dff16 into release/1.5.2 Oct 28, 2026
13 of 14 checks passed
@nv-nmailhot
nv-nmailhot deleted the nmailhot/1.5.2-cp-2308 branch October 28, 2026 16:46

This branch had an error being deployed

1 failed deployment
SWX_AWS — 11aa66fa Deployed Oct 28, 2026 by copy-pr-bot[bot] via Run AWS Tests #10399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants