Repository navigation
Close prefix-lookup shared memory probes and reset a shard's state when its download fails - #54
Merged
Merged
Conversation
…revious state when its download or decompression fails.
Documentation build overview
|
This was referenced Oct 20, 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.
Two fixes for the 0.14.2 release.
Prefix lookup leaves shared memory open. When a dataset starts, the local leader walks the existing shared memory prefixes and opens each
localsblock to check for a reused local directory. Each probe was opened with the defaultauto_cleanup=True, which registers anatexithandler that keeps the mapping and its file descriptor until the process exits, and the probe was never closed. A process that creates many datasets kept two descriptors per probe. The probe now opens withauto_cleanup=False, copies the bytes it needs and closes the block straight away.A failed download leaves the shard stuck in
PREPARING.prepare_shardmarks a shardPREPARING, releases the cache lock and downloads. If the download raised, the shard stayedPREPARING: every worker waiting for it spun forever, and no later call downloaded it again. The same happened when decompressing a zip-only local shard. The shard now goes back toREMOTEafter a failed download and back toLOCALafter a failed decompression, so the next call retries (get_itemalready retries on a missing file).Tests
test_check_and_find_closes_probes: 20 probes of an existing prefix leave the open descriptor count unchanged (40 extra on main).test_failed_download_returns_shard_to_remote: a forced download failure leaves the shardREMOTE, and the next call downloads it.test_failed_decompression_keeps_shard_local: a forced decompression failure leaves the shardLOCAL, and the next call decompresses it.gs://,test_forced_race).CHANGELOG entries under Unreleased.