Skip to content

Avoid JSONRPC client write spins#13329

Open
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:jsonrpc-client-write-ready
Open

Avoid JSONRPC client write spins#13329
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:jsonrpc-client-write-ready

Conversation

@bneradt

@bneradt bneradt commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

JSONRPC clients use nonblocking Unix sockets, so a full peer receive
buffer can make write return EAGAIN. The old retry loop treated that
like EINTR and immediately retried forever, which could hang the
jsonrpc server tests during large request and restart coverage.

This waits for socket write readiness before retrying transient
backpressure and treats an unwritable or zero-byte write as a failure.
This also adds a regression test that fills a socketpair and verifies
that the helper returns instead of spinning.

Copilot AI review requested due to automatic review settings June 25, 2026 04:00
@bneradt bneradt added this to the 11.0.0 milestone Jun 25, 2026
@bneradt bneradt self-assigned this Jun 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread src/shared/rpc/IPCSocketClient.cc
Comment thread src/mgmt/rpc/server/unit_tests/test_rpcserver.cc Outdated
JSONRPC clients use nonblocking Unix sockets, so a full peer receive
buffer can make write return EAGAIN. The old retry loop treated that
like EINTR and immediately retried forever, which could hang the
jsonrpc server tests during large request and restart coverage.

This waits for socket write readiness before retrying transient
backpressure and reports ETIMEDOUT when the readiness wait expires,
while preserving readiness poll errors. This also adds a regression
test that fills a socketpair and verifies that the helper returns with
that timeout signal instead of spinning.
@bneradt bneradt force-pushed the jsonrpc-client-write-ready branch from 9a0684c to fb13f27 Compare June 25, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants