Add PREK_MAX_CONCURRENCY environment variable#1697
Merged
j178 merged 1 commit intoj178:masterfrom Feb 27, 2026
Merged
Conversation
📦 Cargo Bloat ComparisonBinary size change: -0.42% (23.9 MiB → 23.8 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
3318291 to
eae84c2
Compare
Allow users to cap the maximum number of concurrent hooks via the PREK_MAX_CONCURRENCY environment variable. The value is clamped between 1 and the available CPU core count. This is useful when ulimit -n is low and concurrent hook execution can exhaust file descriptors. Unlike ulimit, an environment variable can be set in CI configs, .env files, and wrapper scripts without requiring shell builtins. Closes j178#1696 Assisted by AI Co-Authored-By: Claude <[email protected]>
eae84c2 to
735bf9b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1697 +/- ##
==========================================
+ Coverage 91.57% 91.59% +0.01%
==========================================
Files 96 96
Lines 18842 18880 +38
==========================================
+ Hits 17255 17293 +38
Misses 1587 1587 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PREK_MAX_CONCURRENCYenvironment variable to cap the maximum number of concurrent hooksPREK_NO_CONCURRENCYtakes precedence when both are setMotivation
When
ulimit -nis low, concurrent hook execution can exhaust file descriptors. This provides an environment variable to limit concurrency.For #1696
Test plan
mise run lint— no warningsmise run test— all tests passresolve_concurrency: valid value, above CPU count, zero floors to 1, invalid string, empty string, unset, no_concurrency, no_concurrency overrides max