Skip to content

Block on a full reactor command queue instead of failing - #1175

Open
Will Portnoy (willportnoy) wants to merge 1 commit into
uliteboxfrom
wportnoy/ulitebox-reactor-backpressure
Open

Block on a full reactor command queue instead of failing#1175
Will Portnoy (willportnoy) wants to merge 1 commit into
uliteboxfrom
wportnoy/ulitebox-reactor-backpressure

Conversation

@willportnoy

Copy link
Copy Markdown
Member

ReactorClient::request and connect used try_send, so a transiently full command queue surfaced as ResourceExhausted (ENOBUFS to the guest) on an otherwise valid socket operation. A full queue is internal backpressure, not a resource limit the guest should see, and Linux has no broker-momentarily-busy errno. Both now block on send, consistent with the other reactor client methods (close_socket, Stop) that already do; the only remaining send failure is a gone reactor, mapped to Internal / PeerIndeterminate as before. The caller already waits for the reactor's acknowledgement, and these paths run under strictly fewer held locks than the pre-existing blocking sends, so no new lock is held across the blocking send.

ReactorClient::request and connect used try_send, so a transiently full
command queue surfaced as BrokerError::ResourceExhausted (and, for
connect, PeerUnchanged) — which reaches a guest as ENOBUFS on an
otherwise valid socket operation. A full queue is internal backpressure,
not a resource limit the guest should see, and Linux has no "broker
momentarily busy" errno; a valid operation must complete.

Switch both to a blocking send (the caller already waits for the
reactor's acknowledgement, so this is the same order of blocking). The
only remaining send failure is a gone reactor, mapped to Internal /
PeerIndeterminate as before. The other reactor client methods
(close_socket, Stop) already block on send, so this makes request/connect
consistent with them; they run under strictly fewer held locks, so no
new lock is held across the blocking send.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ea6a6c0d-6bb9-4eed-b8f6-5059a53e326d
@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

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.

1 participant