Skip to content
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

Limit workers in ProcessPoolExecutor #1747

Merged
merged 1 commit into from
Apr 22, 2019
Merged

Conversation

pganssle
Copy link
Member

As a mitigation for #1730, this commit limits the number of workers in the ProcessPoolExecutor to 1 (default is the number of CPUs). On PyPy, having a higher number of available workers dramatically increases the number of concurrent processes, leading to some resource exhaustion issues.

This does not address the root issue, but should improve the situation until the root issue is addressed.

@pganssle
Copy link
Member Author

I'm not entirely sure why more than one build backend has pools executing simultaneously. If that's a necessary feature and not something we can fix, maybe having a single shared pool for all backends would help this? Or switching to using just a subprocess invocation?

@benoit-pierre
Copy link
Member

benoit-pierre commented Apr 22, 2019

Could be the same issue as when using pytest-xdist: sometimes the number of processor detected is really high, leading to too many concurrent jobs and crash / timeout issues with PyPy.

I agree with you that this "feature" does not seem necessary.

@pganssle pganssle closed this Apr 22, 2019
@pganssle pganssle reopened this Apr 22, 2019
As a mitigation for pypa#1730, this commit limits the number of workers in
the ProcessPoolExecutor to 1 (default is the number of CPUs). On PyPy,
having a higher number of available workers dramatically increases the
number of concurrent processes, leading to some resource exhaustion
issues.

This does not address the root issue, but should improve the situation
until the root issue is addressed.
@pganssle
Copy link
Member Author

It seems like #1746 has mitigated the problem on Travis, but I think we should still merge this until we figure out why it's spawning even as many processes as it is, because I'm still seeing pypy failures when I run the test suite locally without this change.

@pganssle pganssle merged commit 2b5accf into pypa:master Apr 22, 2019
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