Skip to content

fix(diskio): stop warn!()ing in get_executor() - #5198

Merged
rami3l merged 2 commits into
rust-lang:mainfrom
rami3l:test/ram-budget-snapshot
Nov 7, 2026
Merged

rami3l merged 2 commits into
rust-lang:mainfrom
rami3l:test/ram-budget-snapshot

Conversation

@rami3l

@rami3l rami3l commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Cherry-picked from #5194.

GitHub seems to be silently downgrading the experience on macOS runners by lowering available RAM. This is not always the case, but when it triggers, rustup emits this warning and the snapshots get messed up:

warn: using single-threaded unpacking due to low memory (ram budget:  32.0 MiB < 512.0 MiB threshold), set RUSTUP_IO_THREADS to override

This is only possible when the branch in L500 is triggered without also triggering the error!() call (minimum_ram is set to exactly 32MiB):

rustup/src/diskio/mod.rs

Lines 490 to 505 in 71668d2

pub(super) fn unpack_ram(io_chunk_size: usize, budget: Option<usize>) -> usize {
const RAM_ALLOWANCE_FOR_RUSTUP_AND_BUFFERS: usize = 200 * 1024 * 1024;
let minimum_ram = io_chunk_size * 2;
let default_max_unpack_ram = match effective_limits::memory_limit() {
Ok(effective)
if effective as usize > minimum_ram + RAM_ALLOWANCE_FOR_RUSTUP_AND_BUFFERS =>
{
effective as usize - RAM_ALLOWANCE_FOR_RUSTUP_AND_BUFFERS
}
Ok(_) => minimum_ram,
Err(e) => {
error!("{:#}", anyhow!(e).context("can't determine memory limit"));
minimum_ram
}
};

... which means the available RAM is less than 200MiB. Please note that this only happens to macOS runners; Windows and Linux runners don't have this problem.

I think this warn!() message is still valuable, but don't think it can be that interesting to the user in such circumstances, so I downgraded it from warn!() to debug!().

@rami3l
rami3l requested a review from djc November 6, 2026 15:32
@rami3l
rami3l marked this pull request as ready for review November 6, 2026 16:05
@rami3l
rami3l requested a review from ChrisDenton November 7, 2026 08:54
@rami3l
rami3l force-pushed the test/ram-budget-snapshot branch from f3f570c to c66c865 Compare November 7, 2026 08:54
@rustbot

rustbot commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rami3l
rami3l added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 7, 2026
@rami3l
rami3l added this pull request to the merge queue Nov 7, 2026
Merged via the queue into rust-lang:main with commit d4cb000 Nov 7, 2026
29 checks passed
@rami3l
rami3l deleted the test/ram-budget-snapshot branch November 7, 2026 17:40
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.

3 participants