Skip to content

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

Open
dschervov wants to merge 1 commit into
openucx:masterfrom
dschervov:unified-socket-module-interface-and-implementation-naming
Open

UCS/SOCKET: simple input parameter naming fix#11859
dschervov wants to merge 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);

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 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.

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