fix(proxy,resolver): fix Docker Hub library image pulls and slow manifest resolution#11
Merged
Macbet merged 3 commits intoMar 9, 2026
Conversation
…fest resolution - Normalize single-segment image names with library/ prefix (e.g. nginx → library/nginx) so Docker Hub official images resolve correctly through the proxy - Parse comma-separated Accept header values in content_type_matches() per RFC 7231 §5.3.2, fixing the content-type negotiation that was always falling through to the slow fallback path - Add 200ms grace period in parallel_lookup() after first fallback 200, avoiding the full wait for all fan-out responses when a content-type mismatch occurs
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
nginx,hylang,redis) — single-segment image names now getlibrary/prefix automaticallycontent_type_matches()now correctly parses comma-separated Accept headers per RFC 7231, so the first matching 200 returns immediately instead of waiting for all fan-out responsesparallel_lookup(), preventing full fan-out wait on content-type mismatchProblem
docker pull kcr.infra.p2p.org/proxy/hylang:python3.12-trixiefailed with 404 because Docker CLI doesn't prependlibrary/when pulling through a custom registry (it only does this fordocker.iodirectly). Harbor's Docker Hub proxy expectslibrary/hylang, but we senthylang.docker pull kcr.infra.p2p.org/proxy/grafana/grafana:11.1.0took 5-8s becausecontent_type_matches()compared the entire comma-separated Accept header as a single media type — it never matched, so every request fell into the fallback path that waits for ALL fan-out responses to complete.Changes
src/proxy.rsnormalize_docker_library_image()usingCow<str>(zero-alloc for multi-segment names)src/resolver.rscontent_type_matches()to split Accept header values by comma before matchingparallel_lookup()after first fallback 200Verification
cargo test --all-features)cargo clippy --all-features -- -D warningscleancargo fmt --checkclean