Repository navigation
release the MetaFile lock when a download fails mid-transfer - #921
Merged
ChristopherRabotin merged 2 commits intoNov 27, 2026
Merged
ChristopherRabotin merged 2 commits into
ChristopherRabotin merged 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #921 +/- ##
==========================================
+ Coverage 82.28% 82.52% +0.23%
==========================================
Files 108 108
Lines 21433 21502 +69
==========================================
+ Hits 17637 17745 +108
+ Misses 3796 3757 -39 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ChristopherRabotin
approved these changes
Nov 17, 2026
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.
Summary
MetaFile::processcreates<file>.lockbefore it downloads a remote kernel, and every error branch removes it again except two: a failure while reading the response body (ureq's 30 s global timeout on a slow link, a connection reset, a truncated response, or the 200 MB limit) and a failure writing the bytes to the cache. Both return through?, so the lock stays on disk. From then on everyprocess(false)for that file waits 10 s and fails withPersistentLockuntil someone finds and deletes the lock by hand.falseis the default forMetaFile.process,MetaAlmanac.loadandAlmanac.from_metain Python, so one interrupted download of a large kernel is enough to break loading for good. #294 addedautodeletefor locks left by a killed process; this is the library leaving its own lock behind after an error it already handles.Architectural Changes
No change
New Features
No change
Improvements
No change
Bug Fixes
Call the existing
del_lock_file()before returning on the body read and cache write error paths, the same as theFile::create, HTTP status and connection error branches already do. Successful downloads are unchanged.Testing and validation
Added
failed_download_releases_lock. It serves a response from a local listener whose body is shorter than itsContent-Length, checks thatprocess(false)returns an error, and checks that the lock file is gone. On master the lock is still there and the test fails. With the fix it passes.cargo fmt --all -- --check,cargo clippy -p anise -- -D warningsandcargo test --no-run --no-default-featurespass locally.cargo test -p anise --libshows the same failures with and without this change, all from tests that need the LFS kernels or network downloads.Documentation
This PR does not primarily deal with documentation changes.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.