fix(registry): make sure to process a download after it has completed#14680
Closed
x-hgg-x wants to merge 1 commit intorust-lang:masterfrom
Closed
fix(registry): make sure to process a download after it has completed#14680x-hgg-x wants to merge 1 commit intorust-lang:masterfrom
x-hgg-x wants to merge 1 commit intorust-lang:masterfrom
Conversation
Collaborator
Contributor
|
I've never had a deep grasp of the semantics of the curl crate. So I'm not going to take lead on reviewing this PR. |
Contributor
Contributor
Author
|
Closed in favor of #14694. |
bors
added a commit
that referenced
this pull request
Oct 15, 2024
fix(registry): `HttpRegistry` `block_until_ready` returns early when work is still pending ### What does this PR try to resolve? `block_until_ready` is returning early when there are still pending transfers. This leads to extra restarts of the resolver, impacting performance. In the existing implementation: - `handle_completed_downloads` runs and there are no completed downloads - `multi.perform()` is called and completes new downloads, with no pending transfers remaining - Since there are no items `remaining_in_multi`, the function returns early This fixes the issue by reordering the calls to `multi.perform()`, `handle_completed_downloads`, then the completion check. ### How should we test and review this PR? A test is added that uses cargo's tracing to show the number of blocking calls. First commit shows existing behavior, second commit shows fix. Originally based on the PR #14680 by `@x-hgg-x.` The ordering fix in this PR also avoids an additional `block_until_ready` call for retried failed downloads.
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.
What does this PR try to resolve?
This PR solves the bug found in Eh2406/pubgrub-crates-benchmark#6 (comment).
With this PR we can avoid refetching the same dependency multiple times because a finished download was not processed before returning from the
block_until_ready()method. It also improves the resolving speed sinceactivate_deps_loop()is called less times overall.