Skip to content

UCT/IB: Fix RC provider bandwidth query isolation - #12338

Merged
roiedanino merged 4 commits into
openucx:masterfrom
roiedanino:fix/rc-plugin-query-contract
Nov 17, 2026
Merged

roiedanino merged 4 commits into
openucx:masterfrom
roiedanino:fix/rc-plugin-query-contract

Conversation

@roiedanino

@roiedanino roiedanino commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What?

Fix the attribute mask sent to RC provider bandwidth queries. Move the provider lookup declaration into the extension header.

Why?

A combined bandwidth and TX-token query can cause a bandwidth-only provider to reject the request and lose its cached sample.

Follow-up to #12162.

Limit provider queries to bandwidth when native endpoint attributes are also requested. Clarify internal cancellation ownership and WQE range semantics, and group the provider lookup declaration with the extension interface. Add focused RC coverage for mixed queries, bandwidth fallback, and endpoint event registration.
@roiedanino
roiedanino requested a review from a team as a code owner November 15, 2026 12:26
@roiedanino roiedanino added the WIP-DNM Work in progress / Do not review label Nov 15, 2026
@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@roiedanino roiedanino self-assigned this Nov 15, 2026
@roiedanino
roiedanino requested a review from dmitrygx November 15, 2026 12:31
@roiedanino roiedanino added Ready for Review and removed WIP-DNM Work in progress / Do not review labels Nov 15, 2026
@roiedanino roiedanino changed the title [WIP-DNM] UCT/IB: Fix RC provider bandwidth query isolation UCT/IB: Fix RC provider bandwidth query isolation Nov 15, 2026
Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Resolved
@@ -9,7 +9,6 @@
#endif

#include "ib_mlx5_ext.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ib_mlx5.h was the only include that pulled in <string.h>, and the file still calls strncmp(). It compiles only because uct_iface.h → ucs/arch/cpu.h → <arch>/cpu.h includes <string.h> on every supported arch.

minor: pls add #include <string.h> here; ib_mlx5.h was providing it for the strncmp() call in uct_ib_mlx5_ext_unregister().

Suggested change
#include "ib_mlx5_ext.h"
#include "ib_mlx5_ext.h"
#include <string.h>

Comment thread test/gtest/uct/ib/test_rc.cc Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap (not blocking): the tests install the hook by overwriting iface->ext_ops directly, so the registry path this PR touches — uct_ib_mlx5_ext_register() → uct_ib_mlx5_ext_get_rc_provider() → iface_init/ep_init/iface_cleanup — is still not covered by any gtest (grep finds no test referencing uct_ib_mlx5_ext_register or ext_ops). Registering a test plugin before entity creation would exercise it, but that is arguably outside this follow-up's scope.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@svc-ucx

svc-ucx commented Nov 15, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (jucx JUCX Test aarch64 java11) · commit 8cd114ce

TL;DR: The JUCX Test aarch64 java11 job never ran any build or test — the Azure agent failed during "Initialize job / Prepare build directory" because its workspace: clean: all recursive delete hit ENOTEMPTY on the leftover Maven local repository inside the workspace (bindings/java/src/main/native/build-java/.deps/...). Fix is CI-infra: move the Maven local repo out of the agent workspace (or pre-clean it in the job), then re-run; the PR commit is unrelated.

Full analysis

Summary: Build 145199, job JUCX Test aarch64 java11 on agent ucx-ci-giga02-16 failed at job initialization with ##[error]Directory not empty : '[REDACTED:Base64 High Entropy String].deps/org/codehaus/plexus/plexus-archiver/2.1'.

Root cause: Not a product failure — no checkout, build, or test step ever executed (the whole job log is 12 lines, start to finish in ~1 second). buildlib/jucx/jucx-test.yml declares workspace: clean: all, so the Azure agent must recursively delete the entire workspace before checkout. The JUCX build puts Maven's local repository inside that workspace: bindings/java/src/main/native/Makefile.am:11 sets maven_repo ?= $(java_build_dir)/.deps and passes it via -Dmaven.repo.local=$(maven_repo). That produces a very deep tree of tens of thousands of Maven artifact files/dirs left over from the previous build on this agent. The agent's recursive delete failed with ENOTEMPTY on one of those artifact directories (stale/partially-downloaded Maven artifact dir from a prior run — typical when a previous jucx build was cancelled mid-download, or when a file is recreated/locked during the delete walk). Since "Prepare build directory" is part of Initialize job, the failure is fatal and reported as a job failure even though it is purely workspace-state related and independent of commit 8cd114c (fix/rc-plugin-query-contract, a UCT RC plugin change with no Java/CI surface).

Implicated commit: a25f47e — Alexey Rivkin, "AZP: Full workspace cleanup to fix checkout failures - master (#11136)" (introduced workspace: clean: all for the jucx job, making every run depend on a successful full delete of the in-workspace Maven repo). The PR under test (8cd114c) is not implicated.

File: buildlib/jucx/jucx-test.yml:9-11 (workspace clean: all) together with bindings/java/src/main/native/Makefile.am:11 (maven_repo ?= $(java_build_dir)/.deps)

Suggested fix:

  1. Immediate: re-run the failed job after wiping the stale directory on the agent, e.g. on ucx-ci-giga02: rm -rf [REDACTED:Base64 High Entropy String] (run as the agent user swx-azure-svc; check for leftover java/mvn processes holding files first).
  2. Permanent: stop placing the Maven local repository inside the agent workspace so clean: all no longer has to delete it. Either override it in the pipeline, e.g. add to the Build/Publish/Test steps in buildlib/jucx/jucx-test.yml:
    make -C bindings/java/src/main/native ... maven_repo=$(Agent.HomeDirectory)/.m2/repository-jucx
    (or export MAVEN_OPTS/-Dmaven.repo.local pointing outside $(Build.Repository.LocalPath)), or change the default in Makefile.am to $(HOME)/.m2/repository. This also speeds up the job by reusing the artifact cache.
  3. Optionally add a defensive pre-checkout step (bash: rm -rf "$(Build.Repository.LocalPath)/bindings/java/src/main/native/build-java" || true) plus retryCountOnTaskFailure cannot cover Initialize job, so the cleanup must happen outside the workspace-delete path (agent startup script / cron on the giga nodes).

Related: #11136 (added full workspace cleanup to jucx job), #11030 and bcd935d (prior jucx checkout/workspace fixes); no existing open issue found for this exact Directory not empty signature.

🛡️ This comment had 1 potential secret(s) redacted (Base64 High Entropy String). See request_id 663cb7fb-cab1-4dff-92c7-931a7e89d7d7 in the triage console for the audit trail.

Comment thread src/uct/ib/mlx5/rc/rc_mlx5_ep.c Resolved
*/
ucs_status_t uct_ib_mlx5_ext_register(const uct_ib_mlx5_ext_ops_t *ops);

const uct_rc_mlx5_ext_ops_t *uct_ib_mlx5_ext_get_rc_provider(void);

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: pls add a doxygen comment (and maybe put it next to the RC ops section), every other prototype in this header is documented.

Comment thread test/gtest/uct/ib/test_rc.cc Outdated
uct_rc_mlx5_ext_ops_t ops = {};
uct_rc_mlx5_tx_token_t tx_token = {};
uct_ep_attr_t attr = {};
ucs::handle<uct_rc_mlx5_iface_common_t*, const uct_rc_mlx5_ext_ops_t*>

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: the same ucs::handle<...> ext_ops save/restore block is now duplicated in both tests — pls move it to a small fixture helper.

Comment thread test/gtest/uct/ib/test_rc.cc Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap: uct_iface_set_ep_event_handler() invalid-param paths (params == NULL, missing ..._FIELD_CB) remain untested; the new test covers only the success/unset path. Low value for this follow-up, so not raised inline.

Residual coverage gap (previously reported, unchanged): no gtest goes through uct_ib_mlx5_ext_register() → uct_ib_mlx5_ext_get_rc_provider() → iface_init/ep_init/iface_cleanup; the tests still install the hook by writing iface->ext_ops directly.

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

UCT_RC_MLX5_BASE_EP_DECL(tl_ep, iface, ep);
uct_ep_attr_t result = {.field_mask = ep_attr->field_mask};
uct_ep_attr_t result = {.field_mask = ep_attr->field_mask &
UCT_EP_ATTR_FIELD_BANDWIDTH};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

pls also document this in the ep_query hook comment in ib_mlx5_ext.h — that it is always called with only UCT_EP_ATTR_FIELD_BANDWIDTH set, so a provider can rely on it instead of guessing from the mask. The new provider-visible contract is asserted by the gtest but not stated in the hook documentation, whose current text only says "Requested attributes and provider-owned outputs"; providers cannot rely on an undocumented invariant.

*/
ucs_status_t uct_ib_mlx5_ext_register(const uct_ib_mlx5_ext_ops_t *ops);

const uct_rc_mlx5_ext_ops_t *uct_ib_mlx5_ext_get_rc_provider(void);

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: pls add a doxygen comment like the other registry functions above (uct_ib_mlx5_ext_cleanup, _unregister, _register), noting it returns the rc_ops of the first plugin which provides them, or NULL. The selection rule is not obvious from the name.

@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap (not raised inline, previously reported and unchanged): no gtest exercises uct_ib_mlx5_ext_register() → uct_ib_mlx5_ext_get_rc_provider() → iface_init/ep_init/iface_cleanup; the new tests still install the hook by writing iface->ext_ops directly, which is also why the ep_cleanup/iface_cleanup paths of the moved declaration stay untested.

@svc-ucx

svc-ucx commented Nov 15, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Tests new on worker 3) · commit 89067e79

TL;DR: The gtest run failed on a single case, rc_mlx5/test_uct_peer_failure_sgl_zcopy.put_fail_middle/1 (device mlx5_1:1), which exercises SGL-zcopy peer-failure completion status — a path untouched by this PR's RC-provider ep_query bandwidth changes; this is a timing/device-dependent flake in the assertion added by #12205, so re-run CI and (if it recurs) relax/fix the completion-status race rather than blaming this PR.

Full analysis

Summary: make test in the gtest stage exited with code 1 because exactly 1 of 8990 tests failed: rc_mlx5/test_uct_peer_failure_sgl_zcopy.put_fail_middle/1, where GetParam() = rc_mlx5/mlx5_1:1.

Root cause: The log tail (only the last ~500 lines are retained by Azure's log fetch, and the failing case ran much earlier in the ~3165 s run) shows the failure summary but not the assertion text. From the sources, put_fail_middle calls test_sgl_zcopy_peer_failure(true, SGL_COUNT/2) and asserts that the user completion of the SGL put carries exactly the endpoint error status reported to the error handler: EXPECT_EQ(m_failed_eps[ep0()], comp.uct.status) (test/gtest/uct/test_peer_failure.cc:1634). That equality is order-dependent: if the error CQE of the middle WQE is consumed after the QP/EP is already marked failed, the SGL op is instead completed by the flush/purge path with UCS_ERR_CANCELED (exactly the status the sibling test put_after_failed_put_short expects at line 1696), and the EXPECT_EQ fails. The behavior being asserted was introduced by 15e2185 ("UCT/IB/MLX5/RC: Complete SGL op with ep error status on peer failure", #12205). Only the mlx5_1:1 instance failed while the mlx5_0:1 instance and the neighbouring put_fail_first / put_fail_last cases passed, which is the signature of a race, not a deterministic regression. The PR's own changes (uct_rc_mlx5_base_ep_query in src/uct/ib/mlx5/rc/rc_mlx5_ep.c:75-128) only isolate the UCT_EP_ATTR_FIELD_BANDWIDTH/TX_TOKEN output fields into a local result struct and have no interaction with the SGL-zcopy send or error-completion path.

Implicated commit: Not this PR's commits (89067e7 / 708af17, Roie Danino — RC provider query/bandwidth isolation). The implicated behavior comes from 15e2185, dmitrygx — "UCT/IB/MLX5/RC: Complete SGL op with ep error status on peer failure (#12205)".

File: test/gtest/uct/test_peer_failure.cc:1634 (assertion), test case at test/gtest/uct/test_peer_failure.cc:1868

Suggested fix: Re-trigger the "Tests new on worker 3" job — this failure is unrelated to the RC provider query change in PR #12338. If it reproduces, fix it in the SGL peer-failure path rather than in this PR: either guarantee in rc_mlx5 that a failed SGL chain is completed with the endpoint error status before the flush/purge can cancel it, or relax the test to accept the purge outcome, e.g. EXPECT_TRUE((comp.uct.status == m_failed_eps[ep0()]) || (comp.uct.status == UCS_ERR_CANCELED)), consistent with test_sgl_zcopy_after_failed_put_short (line 1696). Also worth making the gtest harness upload the full gtest output as a build artifact — the whole-build log tail truncates away the actual assertion message for long runs.

Related: #12205 (added the asserted behavior), #12338 (this PR), #12162 (RC plugin hooks)

@roiedanino
roiedanino enabled auto-merge (squash) November 16, 2026 09:26
@svc-ucx

svc-ucx commented Nov 16, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR · commit a87f482b

Summary: Unable to fetch logs — cannot diagnose without them.
Root cause: Unknown — log access failed.
Implicated commit: unknown
File: unknown
Suggested fix: Provide a direct link to the failed build log in a follow-up comment.
Log fetch attempts:

  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=145248'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 145248]
  • fetch_jenkins_stages({'job': 'UCX PR', 'build': 145248}) → [fetch_jenkins_stages ERROR] build URL names Jenkins controller 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=145248', but this deployment is configured for 'https://nbuprod.blsm.nvidia.com/nb
  • fetch_jenkins_logs({'job': 'UCX PR', 'build': 145248}) → [fetch_jenkins_logs ERROR] build URL names Jenkins controller 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=145248', but this deployment is configured for 'https://nbuprod.blsm.nvidia.com/nbu-
  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/ucx/_build/results?buildId=145248'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 145248]
  • fetch_azure_logs({'build_url': 'https://dev.azure.com/ucfconsort/0b36e3f0-8ab9-4a48-b68b-[REDACTED:Hex High Entropy String]/_build/results?buildId=145248&view=logs'}) → [fetch_azure_logs ERROR: no failed job found in timeline for build 145248]

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id ed72974e-c05a-4cea-9293-3de8dee0f766 in the triage console for the audit trail.

@roiedanino
roiedanino merged commit dfd545a into openucx:master Nov 17, 2026
167 checks passed
@roiedanino
roiedanino deleted the fix/rc-plugin-query-contract branch November 17, 2026 09:52
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.

4 participants