Skip to content

Conversation

rami3l
Copy link
Member

@rami3l rami3l commented Sep 7, 2025

I am currently test-driving the new concurrent downloads implementation and would like to try out different download counts. However when doing so I noticed that the previous decision of make both rustup check and rustup toolchain share a common default concurrent download count might not be optimal.

Thus, with this PR:

  1. We check updates for all channels during rustup check unless the download count is overridden to 1.
  2. We make the default download count 2 to hit a better balance between concurrent downloads and error recovery (this can be postponed to another PR if preferred).

@rami3l rami3l requested review from djc and ChrisDenton September 7, 2025 11:50
@rami3l rami3l force-pushed the feat/concurrent-download-default branch 3 times, most recently from f6efb6d to 2fc451f Compare September 8, 2025 13:39

// Ensure that `.buffered()` is never called with 0 as this will cause a hang.
// See: https://github.com/rust-lang/futures-rs/pull/1194#discussion_r209501774
if num_channels > 0 {
Copy link
Member Author

@rami3l rami3l Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will actually hang when .concurrent_downloads() returns non-zero but channels_len is zero. This PR happens to help manifest this regression (the invariant stated in the comment above has been broken since #4455, my apologies for not finding it out earlier).

@rami3l rami3l enabled auto-merge September 8, 2025 13:53
@rami3l rami3l disabled auto-merge September 8, 2025 14:04
@rami3l rami3l force-pushed the feat/concurrent-download-default branch from 2fc451f to b3640c8 Compare September 8, 2025 14:32
@rami3l rami3l force-pushed the feat/concurrent-download-default branch from b3640c8 to 6d5ec41 Compare September 8, 2025 14:58
@rami3l rami3l enabled auto-merge September 8, 2025 14:59
@rami3l rami3l added this pull request to the merge queue Sep 8, 2025
Merged via the queue into rust-lang:master with commit 8a33ea3 Sep 8, 2025
29 checks passed
@rami3l rami3l deleted the feat/concurrent-download-default branch September 8, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants