Skip to content

UCS/SOCKET: simple input parameter naming fix - #11859

Merged
iyastreb merged 1 commit into
openucx:masterfrom
dschervov:unified-socket-module-interface-and-implementation-naming
Sep 2, 2026
Merged

iyastreb merged 1 commit into
openucx:masterfrom
dschervov:unified-socket-module-interface-and-implementation-naming

Conversation

@dschervov

Copy link
Copy Markdown

What?

Fix the function definition/implementation input parameter different naming.

Why?

This makes code more readable (and beautiful).

@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread src/ucs/sys/sock.c
@@ -461,7 +461,7 @@ ucs_status_t ucs_socket_set_buffer_size(int fd, size_t sockopt_sndbuf,
}

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: silent_bind reads broader than the behavior — only the EADDRINUSE case is silenced. Fine given the doc comment clarifies it, just flagging.

@svc-nvidia-pr-review

Copy link
Copy Markdown

Confirm with the author that the header change to silent_bind lands together with the .c definition in the same PR — the header change isn't shown in the reviewed diff snippet, and they must land together, otherwise the intent of the rename is incomplete.

@dschervov

Copy link
Copy Markdown
Author

Confirm with the author that the header change to silent_bind lands together with the .c definition in the same PR — the header change isn't shown in the reviewed diff snippet, and they must land together, otherwise the intent of the rename is incomplete.

Because its already like this, my robot friend! Look:

/**
 * Initialize a TCP server.
 * Open a socket, bind a sockaddr to that socket and start listening on it for 
 * incoming connection requests.
 *
 * @param [in]  saddr             Sockaddr for the server to listen on. 
 *                                If the port number inside is set to zero -
 *                                use a random port.
 * @param [in]  socklen           Size of saddr.
 * @param [in]  backlog           Length of the queue for pending connections -
 *                                for the listen() call.
 * @param [in]  silent_bind       Whether or not to print error message on bind
 *                                failure with EADDRINUSE.
 * @param [in]  reuse_addr        Whether or not to allow the socket to use an
 *                                address that is already in use and was not 
 *                                released by another socket yet.
 * @param [out] listen_fd         The fd that belongs to the server.
 *
 * @return UCS_OK on success or an error code on failure.
 */
ucs_status_t ucs_socket_server_init(const struct sockaddr *saddr, socklen_t socklen,
                                    int backlog, int silent_bind, int reuse_addr,
                                    int *listen_fd);

@dschervov
dschervov force-pushed the unified-socket-module-interface-and-implementation-naming branch from 3502520 to 23c84ef Compare August 31, 2026 18:36
@svc-nvidia-pr-review

Copy link
Copy Markdown

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

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Review complete — no issues found.

@dschervov
dschervov force-pushed the unified-socket-module-interface-and-implementation-naming branch from 23c84ef to 2db3ef8 Compare September 1, 2026 07:41
@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread src/ucs/sys/sock.c

ucs_status_t ucs_socket_server_init(const struct sockaddr *saddr, socklen_t socklen,
int backlog, int silent_err_in_use,
int backlog, int silent_bind,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inconsistent parameter name. The header sock.h was renamed to silent_bind, but the .c definition still uses silent_err_in_use. This compiles (C ignores prototype vs. definition parameter-name mismatches), but the rename is incomplete and leaves the two files inconsistent, defeating the purpose of the PR.

Suggested change
int backlog, int silent_bind,
int backlog, int silent_bind,

Pls also rename the use on the errno == EADDRINUSE check below; the header already uses silent_bind, so the definition here is left inconsistent.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

What are talking about? I do just that!

Comment thread src/ucs/sys/sock.c
ret = bind(fd, saddr, socklen);
if (ret < 0) {
if ((errno == EADDRINUSE) && silent_err_in_use) {
if ((errno == EADDRINUSE) && silent_bind) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inconsistent parameter name; rename the use on the errno == EADDRINUSE check to match the header's silent_bind.

Suggested change
if ((errno == EADDRINUSE) && silent_bind) {
if ((errno == EADDRINUSE) && silent_bind) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You are being silly, mr. Robot

@svc-nvidia-pr-review

Copy link
Copy Markdown

Note on the prior review comment: the earlier finding asked to confirm the header lands with the .c change. The actual state in the PR head is the inverse — the header was renamed but the .c definition was not — so rather than +1'ing that thread, this warrants a fresh, correct inline comment pointing at the unchanged .c lines.

Regarding scope/tests: this is a pure rename with no functional change, so no new tests are required (existing TCP listener CI exercises the code path). No other issues found.

@svc-ucx

svc-ucx commented Sep 1, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (EFA_Tests EFA on rhel90_ib) · commit 2db3ef8c

TL;DR: The EFA job didn't fail on any code error — the Azure Pipelines agent received a shutdown/cancel signal at 08:00:17 while gtest sources were still compiling, so the whole build (5 jobs) was canceled. Simply re-run the pipeline; no code change is warranted.

Full analysis

Summary: EFA on rhel90_ib (build 133545) was terminated mid-compile by an agent shutdown, not by a compile or test failure.

Root cause: Infrastructure/cancellation, not a code defect. The log shows a continuous, healthy make of the gtest suite (ucp/test_ucp_tag_mem_type.cc, test_ucp_tag.cc, test_ucp_tl_info.cc, …) with steady output every 2–15 s — the largest inter-line gap is well under a minute, so nothing hung and nothing was legitimately starved of time. At 2026-09-01T08:00:17.4388642Z the agent emitted ##[error]The agent has received a shutdown signal. This can happen when the agent service is stopped, or a manually started agent is canceled., followed by The Operation will be canceled and The operation was canceled, then orphan-process cleanup killing the live make/g++/cc1plus and test_efa.sh processes. No compiler error, no linker error, no gtest ever ran (the build never reached the test phase). Corroborating evidence: the same build reports 5 simultaneously "failed" jobs (EFA on rhel90_ib, Test wire compatibility new ucx_1_17, Test wire compatibility new ucx_1_18, new on worker 2, new on worker 0) — a fan-out pattern typical of a build-level cancellation (e.g. superseded by a newer push to PR #11859, or an agent pool restart), not of a change in src/ucs/sys/sock.* from this PR.

Implicated commit: none — commit [REDACTED:Hex High Entropy String] is not implicated; no build output attributable to the PR's changes failed.

File: n/a (failure originates in the Azure agent, last active build unit: test/gtest/ucp/test_ucp_tl_info.cc compile, step "Build rdma-core and ibmock")

Suggested fix: Re-queue build 133545 / re-run the failed jobs on PR #11859 — the result is not actionable as-is. If this recurs across builds on the same pool, have CI ops check the rhel90_ib agent host for service restarts, OOM-killer activity, or spot/preemption events around 08:00 UTC. Two secondary cleanups worth filing separately: (1) the step label "Build rdma-core and ibmock" actually contains the full UCX + gtest build, which makes triage misleading; (2) the gtest object build is the long pole here (~7 min of the job) — increasing make -j parallelism would shrink the window in which a preemption can wipe out the job.

Related: none found (no matching issue/PR for the agent shutdown signature in this repo).

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id c9269050-d723-4dfb-9f10-be2e8498c823 in the triage console for the audit trail.

Function "ucs_socket_server_init" define the
input parameter "silent_bind" (and commentary
confirms that). But in actual implementation
his naming is different. So i decide to
fix that, and the code become more clear.
@dschervov
dschervov force-pushed the unified-socket-module-interface-and-implementation-naming branch from 2db3ef8 to 95e9179 Compare September 1, 2026 08:19
@svc-nvidia-pr-review

Copy link
Copy Markdown

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

Comment thread src/ucs/sys/sock.c

ucs_status_t ucs_socket_server_init(const struct sockaddr *saddr, socklen_t socklen,
int backlog, int silent_err_in_use,
int backlog, int silent_bind,

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 header was renamed to silent_bind but the definition here still uses silent_err_in_use. pls rename here too so the header and implementation match.

Comment thread src/ucs/sys/sock.c
ret = bind(fd, saddr, socklen);
if (ret < 0) {
if ((errno == EADDRINUSE) && silent_err_in_use) {
if ((errno == EADDRINUSE) && silent_bind) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
if ((errno == EADDRINUSE) && silent_bind) {
if ((errno == EADDRINUSE) && silent_bind) {

complete the rename in the function body as well.

@svc-nvidia-pr-review

Copy link
Copy Markdown

src/ucs/sys/sock.c

The rename is incomplete: src/ucs/sys/sock.h uses silent_bind (param name + doc comment), but src/ucs/sys/sock.c still uses silent_err_in_use in both the function definition (line 464) and the function body (line 496). This compiles (C doesn't require matching parameter names between declaration and definition), so CI passes, but the header and implementation are now inconsistent and the intent of the rename is not achieved.

Pure rename with no functional change, so no new tests are required — existing TCP listener CI exercises the path. No other issues found.

@dschervov

Copy link
Copy Markdown
Author

@guy-ealey-morag , i am grateful for the review! ❤️

@dschervov

Copy link
Copy Markdown
Author

@iyastreb, thank for the the approve, Ilia! 🙏

@iyastreb
iyastreb merged commit 8e07678 into openucx:master Sep 2, 2026
162 checks passed
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.

5 participants