Skip to content

Answer 503 when the Wayback Machine is unavailable for now - #121

Merged
paskal merged 1 commit into
masterfrom
archive-busy-retry
Dec 5, 2026
Merged

paskal merged 1 commit into
masterfrom
archive-busy-retry

Conversation

@paskal

@paskal paskal commented Dec 5, 2026

Copy link
Copy Markdown
Member

Previously, when a rule fetched the Wayback Machine copy of a page and archive.org limited the rate (429), failed on its side (5xx), did not answer, or cut its answer short, both extraction endpoints answered 400 with "can't extract content", the same as for a page that cannot be extracted at all. Callers took that as final: ukeeper-worker sent a "Link failed" book for links that extracted fine a few minutes later. In one bulk run this happened to 10 of 237 links.

After this change, those cases answer 503 Service Unavailable on /api/extract and on the legacy parser endpoint, so a caller knows to ask again later. A page with no archived copy, a copy the archive no longer has, a binary or corrupt copy and a redirect loop still answer 400. The README describes the new answer.

Verified: the archive retriever tests cover each failure above, and TestServer_ExtractArchiveUnavailable checks the status of both endpoints for an unavailable archive and for a page with no archived copy. The new tests fail with the change reverted. Lint and race tests pass.

When archive.org limited the rate, failed on its side, did not answer or
cut its answer short, the extraction endpoints answered 400 "can't extract
content", which callers took as final. Those cases now answer 503 so a
caller asks again later; a missing, binary or corrupt copy and a redirect
loop still answer 400.
@paskal
paskal requested a balanced review from Copilot December 5, 2026 13:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@paskal
paskal merged commit 5a89d91 into master Dec 5, 2026
2 checks passed
@paskal
paskal deleted the archive-busy-retry branch December 5, 2026 13:20
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.

2 participants