Skip to content

Commit 35370f4

Browse files
eoinsha-hhermes-agent
andauthored
fix: cap uv concurrency to prevent ENFILE errors during bundling (#14)
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. Co-authored-by: hermes-agent <hermes@hermes-agent.local>
1 parent 38fed9c commit 35370f4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/bundling.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ function getBuilderEnvironment(
365365
): Record<string, string> {
366366
return {
367367
UV_PYTHON_LAMBDA_NOFILE_LIMIT: BUILDER_NOFILE_LIMIT.split(':')[0],
368+
// Cap uv concurrency to avoid system-wide file descriptor exhaustion
369+
// during parallel extraction (os error 23: ENFILE).
370+
UV_CONCURRENT_DOWNLOADERS: '4',
371+
UV_CONCURRENT_BUILDS: '2',
368372
...environment,
369373
};
370374
}

0 commit comments

Comments
 (0)