-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests/test_blackd.py
runs out of fds on systems with high nproc (is blackd leaking fds?)
#4504
Labels
T: bug
Something isn't working
Comments
gentoo-bot
pushed a commit
to gentoo/gentoo
that referenced
this issue
Oct 26, 2024
Use pytest-forked to workaround fd leaks in blackd that cause the test suite to fail and hang on systems with high nproc (i.e. our arm64 and sparc devboxes). Bug: psf/black#4504 Signed-off-by: Michał Górny <[email protected]>
Possibly related to python/cpython#124706. I found that adding some |
Actually, I've tried adding Oh, and with Python 3.13 it's easier to reproduce:
|
Thanks a lot! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When running the test suite on a machine with high nproc (i.e. large number of CPUs/cores — we have 80 on arm64 and 256 on sparc), the test suite suddenly runs out of fds in middle of testing
tests/test_blackd.py
. The remaining blackd tests fail, then pytest hangs when it's supposed to exit.To Reproduce
nproc
… (perhaps some mocking will work?)tox -e py312-ci
(xdist in non-CI jobs works around the problem)Expected behavior
Test suite passing.
Environment
Additional context
To not shadow the issue, here's a minimal log:
(note I had to ^C it, as it was hanging)
My initial guess was that
ProcessPoolExecutor
is not cleaned up whenmain()
finishes, but hacking a.shutdown()
in doesn't seem to help. Addingmax_workers=
does (with values up to 29 here).The setup here is using the default
ulimit -n 1024
.The text was updated successfully, but these errors were encountered: