Repository navigation
Answer 503 when the Wayback Machine is unavailable for now - #121
Merged
Merged
Conversation
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.
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.
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
400with "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 Unavailableon/api/extractand 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 answer400. The README describes the new answer.Verified: the archive retriever tests cover each failure above, and
TestServer_ExtractArchiveUnavailablechecks 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.