runner: retry reporting a build's outcome when the server is unreachable !320

merged merged by cmc on 2026-09-07 04:54 UTC · krz/gitbay:runner-report-retry-179 into main

Discussion

cmc

First of three for #179, and the smallest: it covers the server-side variant entirely.

Build 1043 finished, the runner ran runner done while gitbayd was restarting for a deploy, ssh returned 255 with "connection refused", and the runner logged it and moved on. The server kept the build running.

reportDone retries a connection-level failure — ssh exit 255 — four times over about thirty seconds, which outlasts a restart. Any other exit is the server's answer (not running, not found, denied) and is returned at once; asking again would not change it.

Not retried: the runner log stream. It is a long-lived session; if it breaks mid-build the sink already absorbs it and only log lines are lost, not the result.

Three unit tests through an injected report function: retried to success, not retried on a server answer, bounded.

Ref #179