Skip to content

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

Merged
jochumdev merged 1 commit into
lxc:mainfrom
alien43:fix/transient-incus-connection-retry
Sep 27, 2026
Merged

jochumdev merged 1 commit into
lxc:mainfrom
alien43:fix/transient-incus-connection-retry

Conversation

@alien43

@alien43 alien43 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

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

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

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
alien43 force-pushed the fix/transient-incus-connection-retry branch from 16262ae to f7bf6f5 Compare September 27, 2026 20:27
@jochumdev
jochumdev merged commit 1272f64 into lxc:main Sep 27, 2026
7 checks passed
@jochumdev

Copy link
Copy Markdown
Member

Thank you!

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