Skip to content

fix(iclient): retry an operation listener the server was slow to accept - #217

Merged
jochumdev merged 3 commits into
lxc:developfrom
jochumdev:20260927-develop-01
Sep 28, 2026
Merged

jochumdev merged 3 commits into
lxc:developfrom
jochumdev:20260927-develop-01

Conversation

@jochumdev

Copy link
Copy Markdown
Member

async() opens the operation's event listener before it sends the request. When incusd does not answer that websocket upgrade within the 5s handshake timeout, the whole operation fails with "opening the event socket: read unix ... i/o timeout". Seen in production on an idle host: a nightly up --recreate failed its stop and its delete this way, both in the same second, and incusd logged "Failed upgrading event connection ... broken pipe" as it answered a client that had already gone. An immediate re-run succeeded.

Nothing has been sent to the server at that point, so opening the listener again cannot run anything twice. listenOperationEvents retries it on a timeout only, with the same budget and delay waitOutOperation already uses for a socket lost mid-operation. A server that answers, a refusal for example, answers the same way again, so that still fails at once.

The handshake timeout becomes a Connection field, as eventSilence is, so a test does not wait five seconds per attempt.

alien43 and others added 3 commits September 27, 2026 23:36
async() opens the operation's event listener before it sends the request.
When incusd does not answer that websocket upgrade within the 5s handshake
timeout, the whole operation fails with "opening the event socket: read unix
... i/o timeout". Seen in production on an idle host: a nightly `up --recreate`
failed its stop and its delete this way, both in the same second, and incusd
logged "Failed upgrading event connection ... broken pipe" as it answered a
client that had already gone. An immediate re-run succeeded.

Nothing has been sent to the server at that point, so opening the listener
again cannot run anything twice. listenOperationEvents retries it on a
timeout only, with the same budget and delay waitOutOperation already uses
for a socket lost mid-operation. A server that answers, a refusal for
example, answers the same way again, so that still fails at once.

The handshake timeout becomes a Connection field, as eventSilence is, so a
test does not wait five seconds per attempt.
Signed-off-by: René Jochum <rene@jochum.dev>
Signed-off-by: René Jochum <rene@jochum.dev>
@jochumdev
jochumdev merged commit 0e52dd0 into lxc:develop Sep 28, 2026
10 of 11 checks passed
@jochumdev
jochumdev deleted the 20260927-develop-01 branch October 1, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants