Skip to content

🔁 lore-bin: Re-resolve DNS on every download retry - #48

Merged
maxded merged 1 commit into
mainfrom
lore-bin-fresh-curl-per-retry
Oct 21, 2026
Merged

maxded merged 1 commit into
mainfrom
lore-bin-fresh-curl-per-retry

Conversation

@maxded

@maxded maxded commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Problem

The retries from #47 never help when a DNS lookup goes wrong, and on the self-hosted runners that is the failure we keep hitting. In this Evolve CI job the IPv4 (A) lookup for the mirror timed out and only IPv6 addresses came back, which the runner can't reach:

* IPv6: 2606:4700:3030::6815:4cf9, 2606:4700:3033::ac43:ca82
* IPv4: (none)
* Immediate connect fail for 2606:4700:3030::6815:4cf9: Cannot assign requested address
curl: (7) Failed to connect to artifacts.bonk.rs port 443 after 4006 ms: Could not connect to server
* Hostname artifacts.bonk.rs was found in DNS cache
...

curl keeps DNS answers for 60 s within one process, and --retry retries inside that same process. Every one of the 10 retries (50 s in total) took the cached IPv6-only answer and failed in 0 ms.

Changes

  • Retry by starting a fresh curl for each attempt instead of using curl's --retry, so each attempt does a new DNS lookup.
  • 5 attempts with 2, 4, 8 and 16 s between them (about 30 s of waiting), down from 10 attempts 5 s apart. That covers a blip such as one timed-out DNS query, and a longer outage fails the build either way. This replaces --retry-max-time 180.
  • A line on stderr for each failed attempt, saying when the next one starts. --verbose stays.

Evidence

Pointing download at an unresolvable host locally, every attempt runs its own lookup (Could not resolve host) instead of reporting a hit in the DNS cache. A real download on Linux x86_64 still fetches and extracts the library.

🤖 Generated with Claude Code

curl caches DNS answers for 60 s within a process, so `--retry` reused a
lookup that came back with only IPv6 addresses on a runner without IPv6,
failing all retries. Start a fresh curl per attempt instead, with 5
attempts backing off 2, 4, 8 and 16 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@maxded maxded added the bug Something isn't working label Oct 21, 2026
@maxded
maxded requested a review from LuukAsmus October 21, 2026 07:18
@maxded

maxded commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

and only IPv6 addresses came back, which the runner can't reach:

@patchandpray is this something we should look into on the runners?

@maxded
maxded merged commit 1eeafb3 into main Oct 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants