fix: retry version-index fetches and treat timeouts as transient - #20
Merged
Merged
Conversation
Version resolution fetches ziglang.org/download/index.json (and
pkg.machengine.org/zig/index.json for mach versions) before any mirror
is contacted, with an 8s timeout and no retry — so a single slow
response failed the whole job before anything else was attempted. This
took out a macos-14 mach smoke job when pkg.machengine.org was slow.
Two fixes:
- Wrap the index fetches in withRetry, matching how mirror downloads
are already handled.
- Classify TimeoutError as transient. AbortSignal.timeout() rejects
with a DOMException named TimeoutError, not AbortError, and its
message ("The operation was aborted due to timeout") matches none of
the errno patterns — so isTransient returned false and a slow mirror
was written off as a deterministic failure, skipping its retry.
chicoxyzzy
pushed a commit
that referenced
this pull request
Sep 9, 2026
🤖 I have created a release *beep* *boop* --- ## [1.0.4](v1.0.3...v1.0.4) (2026-09-09) ### Fixed * retry version-index fetches and treat timeouts as transient ([#20](#20)) ([7d1bd82](7d1bd82)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: xyzzylabs-release-bot[bot] <298273869+xyzzylabs-release-bot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
macos-14 / 2024.5.0-machsmoke job failed withThe operation was aborted due to timeoutroughly 8s into the action, before any mirror was contacted. Two independent gaps caused it.1. Version-index fetches had no retry
fetchJsonWithTimeouthitsziglang.org/download/index.json(andpkg.machengine.org/zig/index.jsonfor mach versions) with an 8s timeout and no retry. This runs before mirror selection, so one slow response fails the whole job with nothing else attempted — no mirror racing, no fallback. Now wrapped inwithRetry, matching how tarball and signature downloads are already handled.2.
isTransientdid not classify timeoutsAbortSignal.timeout()rejects with aDOMExceptionnamedTimeoutError, notAbortError, and its message matches none of the errno patterns:So
isTransientreturnedfalse. This is the more consequential half: it means the mirror retry path was also silently declining to retry timeouts — a slow mirror was treated as a deterministic failure (like a signature mismatch) and written off after one attempt.Tests
Added a case that derives the error from a real
AbortSignal.timeout()rather than a hand-built stub, so it stays honest if the runtime's error shape changes.73/73 pass; typecheck clean;
dist/rebuilt.