Repository navigation
Retry CDN origin errors, network failures and timeouts - #1
Merged
Merged
Conversation
The first scheduled Snapshot run (2026-10-19) stopped after 26 minutes, 500 of 4,842 detail reads in, on a single 520 from the CDN in front of heyresearch.xyz: 520-524 were not in the retryable set, and a thrown network error or timeout was never retried either. - 520, 521, 522, 523 and 524 are retried like a 502, with the server's retry-after or the 30 s default, within --max-retries. - A network failure or a timeout is retried the same way; an oversized body is still not. Every request is a GET. - The Snapshot workflow passes --max-retries 3. - The resume tests stop their runs with maxRetries 0, so one injected failure still stops the run they resume.
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.
Problem
The first scheduled Snapshot run (run 39215293192, 2026-10-19) failed after 26 minutes, 500 of 4,842 detail reads in, on one answer:
520 is what Cloudflare, in front of heyresearch.xyz, answers when the origin errs.
politeFetchretried only 429, 500, 502, 503 and 504, so a single transient edge error ended a run of thousands of requests. A thrown network error or timeout was not retried either. The weekly release has never been produced.What changed
src/http.ts: 520–524 join the retryable set and are retried like a 502 (the server'sretry-after, else 30 s), within--max-retries. A network failure or timeout is retried the same way. An oversized body is still not retried. Every request hey-data makes is a GET, so a retry is safe..github/workflows/snapshot.yml: the run passes--max-retries 3.test/http.test.ts: four new tests:test/generate.test.ts: the three resume tests stop their runs withmaxRetries: 0. They inject one network failure to produce a stopped run, and with the default single retry that failure would now be absorbed instead of stopping the run.--helptext and CHANGELOG describe the new retry set.Validation
pnpm scan,pnpm lint,pnpm typecheck,pnpm build,prettier --check .: pass.pnpm test: 42 passed. Three of the new tests fail againstmain'ssrc/http.tsand pass with this change. The fourth, the oversized-body test, guards behaviour that is already correct.generate --no-details --evidence-limit 0 --max-retries 3wrote 4,851 projects, 4,353 ships and 26,281 changes, with totals checks passing. That run met no transient error, so it shows the change breaks nothing; the retry paths themselves are covered by the unit tests.Limitations
resume_from_runinput resumes it from the uploaded partial work.