Skip to content

fix(runners): recover from a network outage promptly - #768

Merged
aixle-com[bot] merged 4 commits into
developfrom
feature/runner-outage-recovery
Nov 19, 2026
Merged

aixle-com[bot] merged 4 commits into
developfrom
feature/runner-outage-recovery

Conversation

@NOX73

@NOX73 NOX73 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

Fixes #256 (found by #252 step 9): after a network outage the runner kept writing to a dead connection for 18 minutes, and the machine went Failed.

  • Runner (runner/internal/protocol/client.go). The default HTTP client now pings an HTTP/2 connection silent for 15 s and closes it if the ping is not answered in 10 s, bounds dialing, enables TCP keep-alives, and closes idle connections after a request got no answer. A request that timed out in the outage no longer leaves its dead connection in the pool for the next poll, heartbeat or token request.
  • Platform (RunnerRuntime#cleanup_session). A machine could be "heard" by a request whose answer never reached the runner, so the cleanup sent env.reset, nobody answered, and the machine was failed ("the runner did not answer"). For a session that lost contact, an expired env.reset now leaves the session holding the machine; the cleanup sends a new reset when the machine is heard again (DESIGN.md §6.7).
  • Docs: DESIGN.md §6.7, PROTOCOL.md §1, CHANGELOG.

Release

This PR does not release the runner. #264 releases aixle-runner 0.4.1 after all the #252 fixes are merged, and pins its digests and the recommended version in config/settings.yml (runners.release).

How to test

  • cd runner && go vet ./... && go test -race ./...; TestARequestAfterAConnectionDiedSilentlyDialsAgain kills a connection without closing it and shows the next poll reaches the server.
  • bin/rails test test/services/container_runtime/runner_runtime_test.rb: an unanswered reset of a lost-contact session keeps the machine, which resets and goes idle when heard.

…eep the machine when its reset goes unanswered

The runner's HTTP client reused a connection that died in an outage until TCP gave up. It now health-checks HTTP/2 connections and closes idle ones after a request got no answer. A reset left unanswered for a session that lost contact no longer fails the machine.

Signed-off-by: Alex <[email protected]>
Comment thread runner/internal/protocol/client.go Resolved

@aixle-com aixle-com Bot 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.

No blocking issues. Two non-blocking recommendations are in the inline comments.

@aixle-com aixle-com Bot 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.

Re-review of a641dc4 (changes since ceaa301): the doc comment, the NewClient wiring test and the !machine(session).heard? condition match the decisions. No new findings.

…age-recovery

Signed-off-by: Alex <[email protected]>

# Conflicts:
#	CHANGELOG.md
@aixle-com
aixle-com Bot merged commit 4da1207 into develop Nov 19, 2026
18 checks passed
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