fix(registry): handle Poll::Pending from sparse registry source queries#431
Open
rconnol wants to merge 1 commit intokbknapp:masterfrom
Open
fix(registry): handle Poll::Pending from sparse registry source queries#431rconnol wants to merge 1 commit intokbknapp:masterfrom
rconnol wants to merge 1 commit intokbknapp:masterfrom
Conversation
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.
Issue
Title:
cargo outdatedpanics with sparse private registries: "Source should be ready"Summary
cargo outdatedpanics (v0.17.0) or bails (v0.18.0) when used with a project that depends on a sparse private registry.Details
When querying a sparse registry source,
source.query_vec()returnsPoll::Pendingon the first call because sparse registries (HttpRegistry) fetch package metadata on-demand via HTTP. The first call initiates the async request and returnsPending— the data isn't available untilblock_until_ready()is called to drive the HTTP response to completion.The current code in
find_update()callsblock_until_ready()once beforequery_vec(), which is a no-op for sparse registries since no requests are in flight yet. Whenquery_vec()then returnsPoll::Pending, it is treated as a fatal error.Cargo itself handles this with a poll loop:
https://github.com/rust-lang/cargo/blob/60400187f/src/cargo/core/resolver/errors.rs#L479-L488
Steps to Reproduce
~/.cargo/config.toml:cargo outdatedv0.17.0
v0.18.0
Expected Behavior
cargo outdatedshould query the sparse registry successfully and report outdated dependencies.PR
Title:
fix: handle Poll::Pending from sparse registry source queriesSummary
Poll::Pendingfrom sparse registry sourcesblock_until_ready()call that was a no-op for sparse registriesDetails
Sparse registries (
sparse+https://...) fetch package metadata on-demand via HTTP. The firstquery_vec()call initiates the request and returnsPoll::Pending. The fix replaces thesingle query + bail with the same poll loop cargo itself uses:
https://github.com/rust-lang/cargo/blob/60400187f/src/cargo/core/resolver/errors.rs#L479-L488
Test plan
just cipasses