Skip to content

fix: cap uv concurrency to prevent ENFILE errors during bundling#14

Merged
eoinsha merged 1 commit intofourTheorem:feat/builder-containerfrom
eoinsha-h:feat/builder-container
Apr 17, 2026
Merged

fix: cap uv concurrency to prevent ENFILE errors during bundling#14
eoinsha merged 1 commit intofourTheorem:feat/builder-containerfrom
eoinsha-h:feat/builder-container

Conversation

@eoinsha-h
Copy link
Copy Markdown

Problem

When uv extracts many wheel files in parallel, the builder container can
exhaust the system-wide file descriptor limit (os error 23: Too many open files), especially on Docker Desktop/macOS environments.

This causes intermittent failures like:

× Failed to extract archive: aws_lambda_powertools-3.28.0-py3-none-any.whl
╰─▶ failed to create file ... Too many open files in system (os error 23)

Solution

Add UV_CONCURRENT_DOWNLOADERS=4 and UV_CONCURRENT_BUILDS=2 to the builder
container environment to limit uv's internal parallelism.

These are official uv concurrency settings that prevent FD exhaustion without meaningfully impacting performance.\n\n## Verification

All 30 tests pass consistently across 5 consecutive runs (150 total executions, zero failures).

When uv extracts many wheel files in parallel, the builder container can
exhaust the system-wide file descriptor limit (os error 23: Too many open
files), especially on Docker Desktop/macOS environments.

Add UV_CONCURRENT_DOWNLOADERS=4 and UV_CONCURRENT_BUILDS=2 to the builder
environment to limit uv's internal parallelism. This prevents the FD
exhaustion without meaningfully impacting performance, since most wheels
are served from cache on subsequent builds.

Fixes intermitent 'CommandExitedWithNonZeroStatus: docker exited with
status 1' errors caused by failed wheel extraction.
@eoinsha eoinsha merged commit 35370f4 into fourTheorem:feat/builder-container Apr 17, 2026
5 checks passed
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