Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threaded FS IO probably should be async now? #4159

Open
rami3l opened this issue Jan 17, 2025 · 2 comments
Open

Threaded FS IO probably should be async now? #4159

rami3l opened this issue Jan 17, 2025 · 2 comments
Milestone

Comments

@rami3l
Copy link
Member

rami3l commented Jan 17, 2025

Being able to use async where relevant across the codebase makes it possible to use async constructs where relevant. rustup has many places where that can be useful: downloading channel metadata, distribution content, unpacking that content to disk, are work that could usefully proceed in parallel - and async provides a good abstraction for that.

We already have a sophisticated disk IO layer that accomodates various OS latency-inducing behaviours, and adapting that to async without any regressions could be very interesting too - but for now, it co-exists nicely with an async core.
#3367

We are still using an async-unaware threadpool here, and it's known to produce problems (#3125):

/// Threaded IO model: A pool of threads is used so that syscall latencies
/// due to (nonexhaustive list) Network file systems, virus scanners, and
/// operating system design, do not cause rustup to be significantly slower
/// than desired. In particular the docs workload with 20K files requires
/// very low latency per file, which even a few ms per syscall per file
/// will cause minutes of wall clock time.

Anyway, using RUSTUP_IO_THREADS=1 to limit concurrency feels a bit off. Will migrating to async help?

@djc
Copy link
Contributor

djc commented Jan 17, 2025

IMO the code we have for this looks very complicated/scary. Rewriting it looks like a project, would probably be hard to know if we bring over all the desired properties. async could be helpful but won't make this easy by itself IMO.

@rami3l
Copy link
Member Author

rami3l commented Jan 17, 2025

Ah, I do remember the days when installing Rust took a long time to finish: #1876

(cc the original author, if I'm not mistaken, @rbtcollins)

@rami3l rami3l added this to the On Deck milestone Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants