fix: lake: retry transient artifact transfer failures - #14725
Open
marcelolynch wants to merge 1 commit into
Open
fix: lake: retry transient artifact transfer failures#14725marcelolynch wants to merge 1 commit into
marcelolynch wants to merge 1 commit into
Conversation
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
marcelolynch
force-pushed
the
lake-transfer-retry
branch
3 times, most recently
from
August 10, 2026 16:30
3b9af12 to
4f39097
Compare
This PR makes `lake cache get` and `lake cache put` retry the transfers in a batch that fail in a transient way, instead of failing the whole batch after one attempt. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
marcelolynch
force-pushed
the
lake-transfer-retry
branch
from
August 10, 2026 16:50
4f39097 to
9a00d75
Compare
marcelolynch
marked this pull request as ready for review
August 10, 2026 17:43
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.
This PR makes
lake cache getandlake cache putretry the transfers in a batch that fail in a transient way, instead of failing the whole batch after one attempt. Lake attempts a batch up to 3 times; theLAKE_CACHE_TRANSFER_ATTEMPTSenvironment variable overrides this limit. A retry covers a connection that drops mid-transfer, a download whose bytes do not match the expected content hash, and the transient HTTP status codes (408, 429, 500, 502, 503, 504). A failure that a retry cannot fix, such as a 404, still fails the batch immediately.One dropped connection could previously fail a batch of thousands of transfers. A mathlib CI run showed this: 2 of 8309 downloads hit a dropped HTTP/2 stream, and the whole
lake cache getfailed (log).curl --retrydoes not cover these failures on its own: it retries only timeouts and a fixed set of response codes. It does not retry a connection that drops mid-body. It also cannot detect a corrupted body: without aContent-Length, a stream that ends early looks like a complete transfer, and only Lake's hash check catches it.The console output stays quiet: each retry attempt logs one warning line, and the detail of a failure that will be retried goes to the verbose log. The final attempt logs the same errors as before. For the tests, the mock cache server gains two stateful fault modes:
flakydrops the first request for each object, andflakycorruptcorrupts the first response for each object. New tests cover download and upload retries, the attempt limit, a retry of only part of a batch, a batch that has both a permanent and a transient failure, and that a 404 is not retried.Closes #14739
🤖 Generated with Claude Code