Skip to content

UCP/RNDV: Handle pre-init mtype abort - #11960

Draft
svc-ucx-bot wants to merge 1 commit into
openucx:masterfrom
svc-ucx-bot:bugfix/redmine-5273831-685271ee1922
Draft

svc-ucx-bot wants to merge 1 commit into
openucx:masterfrom
svc-ucx-bot:bugfix/redmine-5273831-685271ee1922

Conversation

@svc-ucx-bot

Copy link
Copy Markdown

What?

Add a dedicated rndv/put/mtype abort handler that directly completes requests when protocol initialization has not finished, while retaining the existing stub-abort path for initialized requests. Add a focused callback guard test.

Why?

A staging allocation failure could occur before req->send.state.uct_comp was initialized. Dispatching ucp_proto_rndv_stub_abort then invoked an uninitialized completion callback and caused a NULL-address SIGSEGV instead of propagating the allocation error.

How?

The new handler records the allocation status and calls the common completion path for pre-initialized requests. Validation repeated the original 96-rank reproducer three times; every run retained the CUDA OOM, propagated MPI_ERR_OTHER, and produced no SIGSEGV. The callback guard passed all 10 instantiated transport suites, the initialized-path peer-failure test passed 1/1, and the build, final gtest link, staged install, and diff check passed.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread src/ucp/rndv/rndv_put.c
{
if (!(req->flags & UCP_REQUEST_FLAG_PROTO_INITIALIZED)) {
req->send.state.uct_comp.status = status;
ucp_proto_rndv_put_common_complete(req);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocker: the uninitialized path ignores the ppln-fragment case. put/mtype is also probed with support_ppln=1, and for a ppln fragment req->send.rndv.rkey is owned by the parent request and completion must go through ucp_proto_rndv_ppln_send_frag_complete(). Here ucp_proto_rndv_rkey_destroy(req) destroys the parent's rkey (still used by other in-flight fragments passing it to uct_ep_put_zcopy(), and destroyed again in ucp_proto_rndv_ppln_frag_complete() — double free / use-after-free), and ucp_proto_rndv_request_zcopy_complete() completes the fragment as a standalone send request, so the parent's completed_size is never advanced (hang) and the fragment is never returned to the mpool (leak). Pls handle ucp_proto_rndv_request_is_ppln_frag(req) separately. This is exactly the low-memory scenario the PR targets, so the fragment path is as likely as the non-fragment one.

context()->cache_md_map[mem_type];
}

UCS_TEST_P(test_ucp_proto, rndv_put_mtype_allocation_failure_abort)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test does not test the fix: EXPECT_TRUE(ucp_rndv_put_mtype_proto.abort != ucp_proto_rndv_stub_abort) is a tautology of the one-line .abort assignment. It does not exercise the allocation failure or abort behavior despite the test name, and it will keep passing if the abort implementation is wrong. Per REVIEW.md, a bug fix should carry a focused regression test. Can we make it exercise the real path, e.g. fail the rndv frag allocation and verify the request completes with an error instead of asserting?

context()->cache_md_map[mem_type];
}

UCS_TEST_P(test_ucp_proto, rndv_put_mtype_allocation_failure_abort)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: placement — the UCS_TEST_P is inserted between the test_ucp_proto member-function definitions (get_md_map() and do_mem_reg()); all other tests in this file come after the definitions. Pls move it down with the other UCS_TEST_P definitions.

@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap: the abort path needs a GPU/mtype-capable job (RNDV_SCHEME=put_ppln with a constrained frag mpool) to be exercised at all; nothing in the current CI matrix appears to hit put/mtype frag allocation failure.

@svc-ucx-bot
svc-ucx-bot marked this pull request as draft September 17, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants