uv/crates/uv-configuration/src
Ibraheem Ahmed 783df8f657
Consolidate concurrency limits (#3493)
## Summary

This PR consolidates the concurrency limits used throughout `uv` and
exposes two limits, `UV_CONCURRENT_DOWNLOADS` and
`UV_CONCURRENT_BUILDS`, as environment variables.

Currently, `uv` has a number of concurrent streams that it buffers using
relatively arbitrary limits for backpressure. However, many of these
limits are conflated. We run a relatively small number of tasks overall
and should start most things as soon as possible. What we really want to
limit are three separate operations:
- File I/O. This is managed by tokio's blocking pool and we should not
really have to worry about it.
- Network I/O.
- Python build processes.

Because the current limits span a broad range of tasks, it's possible
that a limit meant for network I/O is occupied by tasks performing
builds, reading from the file system, or even waiting on a `OnceMap`. We
also don't limit build processes that end up being required to perform a
download. While this may not pose a performance problem because our
limits are relatively high, it does mean that the limits do not do what
we want, making it tricky to expose them to users
(https://github.com/astral-sh/uv/issues/1205,
https://github.com/astral-sh/uv/issues/3311).

After this change, the limits on network I/O and build processes are
centralized and managed by semaphores. All other tasks are unbuffered
(note that these tasks are still bounded, so backpressure should not be
a problem).
2024-05-10 12:43:08 -04:00
..
authentication.rs require serde and rkyv everywhere; remove optional serde and rkyv features (#3345) 2024-05-03 10:21:03 -04:00
build_options.rs Update Rust to v1.78 (#3361) 2024-05-03 20:07:13 +00:00
concurrency.rs Consolidate concurrency limits (#3493) 2024-05-10 12:43:08 -04:00
config_settings.rs Merge user and workspace settings (#3462) 2024-05-08 14:49:43 -04:00
constraints.rs Add basic tool.uv.sources support (#3263) 2024-05-03 21:10:50 +00:00
lib.rs Consolidate concurrency limits (#3493) 2024-05-10 12:43:08 -04:00
name_specifiers.rs Improve JSON Schema and add export script (#3461) 2024-05-08 16:15:16 +00:00
overrides.rs Add basic tool.uv.sources support (#3263) 2024-05-03 21:10:50 +00:00
package_options.rs Accept --no-upgrade, --no-refresh, etc. on the CLI (#3328) 2024-05-01 11:13:33 -07:00
preview.rs Add preview mode and use for warning in uv run (#3192) 2024-04-22 15:41:15 -05:00
target_triple.rs pep508: un-export fields for MarkerEnvironment 2024-05-09 10:06:02 -04:00