Repository navigation
Refresh the Julia name map only from the advertised registry - #565
Merged
Merged
Conversation
Each request for a General registry tarball whose hash differed from the loaded name map started a goroutine that downloaded the whole registry from upstream again, with no limit on concurrent loads and no deadline. Alternating between two valid snapshots made every request cost a full download and parse, and left the map at whichever snapshot came last, older ones included. The refresh now only loads the hash /registries currently lists, read through the metadata cache, runs one load at a time and skips while one is running, and stops after five minutes. Registry.toml is read up to 64 MB.
andrew
approved these changes
Oct 23, 2026
andrew
left a comment
Contributor
There was a problem hiding this comment.
Two follow-ups:
- The new tests all call
refreshNamesFromRegistrydirectly, and nothing covershandleRegistry. A test that requests an old snapshot and then the advertised one throughGET /registry/{uuid}/{hash}, and checks the name map and download counts (polling for the goroutine), would cover the path clients hit. loadRegistryTarballstill downloads the tarball from upstream right afterhandleRegistrycached it, so each new General snapshot costs two full upstream downloads. ReadingRegistry.tomlfrom the cached artifact would drop the second one.
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.
Every request for a General registry tarball with a hash other than the one behind the current name map started a goroutine. That goroutine downloaded the whole registry again from upstream instead of using the copy just cached. Nothing limited how many of these loads ran at once, and they had no deadline. Alternating requests between two valid snapshots therefore cost a full download and parse each time, and the map ended up at whichever snapshot was requested last, older ones included.
What changes:
/registriescurrently lists./registriesis read through the metadata cache that already serves it to clients. Older snapshots are still served, but they no longer trigger a download or replace the map.Registry.tomlis read up to 64 MB.Tests cover old snapshots not being downloaded or rolling back the map, the current one loading once, skipping while a load runs, and the size limit.