-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #14694 - arlosi:fix-extra-blocking, r=weihanglo
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.
- Loading branch information
Showing
2 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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