Repository navigation
UCP/WORKER: Add device filter for worker address query - #11717
Conversation
4c04986 to
a4d3a00
Compare
|
🤖 Starting review — findings will be posted here when done. |
a4d3a00 to
e6a34be
Compare
e6a34be to
ca965ae
Compare
|
🤖 CI Triage Agent — TL;DR: The Coverity stage failed with 2 new FORWARD_NULL defects in Full analysisSummary: Root cause: Both defects are Coverity FORWARD_NULL ("Explicit null dereferenced") false positives introduced by the new test code in this PR:
The library code itself is correct; only the new gtest triggers the checker. Implicated commit: File: Suggested fix: Make the non-NULL invariant explicit so Coverity can see it, in both places: auto status = ucp_worker_query(worker, &worker_attr);
ASSERT_UCS_OK(status);
ASSERT_NE(nullptr, worker_attr.address);
if (worker_attr.address == nullptr) {
return; /* not reached: silence static analysis */
}(equivalently, replace the ASSERT with Related: PR #11717 (branch |
|
🤖 CI Triage Agent — TL;DR: The Coverity Full analysisSummary: Root cause: In
Reading Implicated commit: 7959184 "UCP/TEST: Simplify worker address device tests" (shachar hasson, 2026-08-24), on top of ca965ae "UCP/WORKER: Add device filter for worker address query" (same author) File: test/gtest/ucp/test_ucp_worker.cc:886-919 (defect reported at line 919) Suggested fix: Make the null check explicit and no-return so Coverity prunes the NULL path, e.g. in status = ucp_worker_query(worker, &worker_attr);
ASSERT_UCS_OK(status);
if (worker_attr.address == nullptr) {
UCS_TEST_ABORT("ucp_worker_query() returned NULL address for device " <<
address_device_name);
}
status = ucp_address_unpack(worker, worker_attr.address, ...);
Related: PR #11717 (this PR); precursor commit ca965ae added the |
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
|
🤖 CI Triage Agent — TL;DR: The gpu worker-3 gtest run failed on a single unrelated test, Full analysisSummary: Root cause: From the log, the run completed normally (continuous output, no hang, no crash/sanitizer report) and only this one assertion-level test failed — so it is a test-logic flake, not a build/timeout problem. Implicated commit: Not the PR commit. Pre-existing flaky test; nearest changes to this area are b82a920 (Yossi Itigin, "UCT/TCP: Bound negative connect test timeout") and 2faf305 (Leonid Genkin, "UCS/ASYNC: Filter stale missed fd events"), which touch File: test/gtest/uct/test_sockaddr.cc:990-1004 (assert at :1003); port selection at test/gtest/uct/test_sockaddr.cc:142-144 Suggested fix:
Related: #6451, #6968, #11415, #11458, PR under test: #11717 |
| } | ||
| } | ||
|
|
||
| static bool iface_can_connect(const uct_iface_attr_t &attrs) |
There was a problem hiding this comment.
Per f2f discussion, please check whether other place implement the same logic -> eliminate code duplication
There was a problem hiding this comment.
none of the existing tests checks the content of the returned worker address.
However, In our test we must check the content in order to verify it was filtered by specific device
| } | ||
| } | ||
|
|
||
| static bool iface_can_connect(const uct_iface_attr_t &attrs) |
There was a problem hiding this comment.
constmethods, where applicable.
There was a problem hiding this comment.
all methods are either static or calling sender() (which is non-const)
|
|
||
| class test_ucp_worker_address_query : public ucp_test { | ||
| public: | ||
| enum class address_device_type { |
There was a problem hiding this comment.
Check if we can reuse any existing flags / enums from UCX core code or gtest.
There was a problem hiding this comment.
using directly the flags (INTER_NODE/INTRA_NODE..) makes the code less readable. IMO better stay with this enum
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
What
Add an optional
address_device_nameinput field toucp_worker_attr_tand a matchingUCP_WORKER_ATTR_FIELD_ADDRESS_DEVICE_NAMEfield mask.When
ucp_worker_query()is asked for a worker address with this field set, UCP packs only resources whose context device name matches the requested device. Requests for a device with no addressable worker resources returnUCS_ERR_NO_DEVICE.Why
Some users need to exchange a worker address for a specific network device instead of all resources opened by the worker. This lets applications reduce address payload size and control which device is exposed during out-of-band address exchange.