You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments