Skip to content

Cap the blocking-pool thread count below LMDB's reader limit - #23683

Merged
wisechengyi merged 3 commits into
pantsbuild:mainfrom
NVIDIA:limit_thread_count
Sep 22, 2026
Merged

wisechengyi merged 3 commits into
pantsbuild:mainfrom
NVIDIA:limit_thread_count

Conversation

@svenier

@svenier svenier commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

On large-core-count machines, --rule-threads-max (default 4x --rule-threads-core) can size the blocking thread pool well past LMDB's default 126-reader limit, causing MDB_READERS_FULL errors during local store reads. Clamp the pool to a safe ceiling, fix an underflow that could silently wrap the thread count instead of erroring, and warn when the configured thread counts get capped so the reduced parallelism isn't a silent surprise.

Fixes #23652.

@svenier

svenier commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor Author

AI Disclaimer: Code & documentation changes were LLM assisted

svenier and others added 2 commits September 22, 2026 09:23
On large-core-count machines, `--rule-threads-max` (default 4x
`--rule-threads-core`) can size the blocking thread pool well past
LMDB's default 126-reader limit, causing `MDB_READERS_FULL` errors
during local store reads. Clamp the pool to a safe ceiling, fix an
underflow that could silently wrap the thread count instead of
erroring, and warn when the configured thread counts get capped so
the reduced parallelism isn't a silent surprise.

Fixes pantsbuild#23652.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@wisechengyi
wisechengyi merged commit 122c0ee into pantsbuild:main Sep 22, 2026
28 checks passed
@svenier
svenier deleted the limit_thread_count branch September 22, 2026 21:06
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.

Pants will spawn more threads than LMDB can handle on large machines

2 participants