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

[Errno 32] Broken pipe When Mapping Too Many Values #47

Open
srkunze opened this issue Nov 2, 2015 · 6 comments
Open

[Errno 32] Broken pipe When Mapping Too Many Values #47

srkunze opened this issue Nov 2, 2015 · 6 comments

Comments

@srkunze
Copy link

srkunze commented Nov 2, 2015

First of all, thanks for that great backport. I am using it for the xfork package to support the 2.7 branch.

Unfortunately, there is something strange happening with this futures distribution which works perfectly fine with python3.4

from concurrent.futures import ProcessPoolExecutor

def calc(n):
    with ProcessPoolExecutor() as pool:
        results = pool.map(term, range(n))
        return sum(results)

def term(x):
    return x

print(calc(5000))
/usr/bin/python2.7 calc.py
12497500
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/queues.py", line 266, in _feed
    send(obj)
IOError: [Errno 32] Broken pipe
@kadnan
Copy link

kadnan commented Jul 21, 2017

Did you find solution?

@srkunze
Copy link
Author

srkunze commented Aug 3, 2017

@kadnan Not yet. Run short of time for now. Could you find something out?

@agronholm
Copy link
Owner

Process pooling is pretty broken on Python 2.7. I should add something to the docs to strongly discourage its use.

@agronholm
Copy link
Owner

@srkunze Out of curiosity, would you mind testing on PyPy?

@dalcinl
Copy link
Contributor

dalcinl commented Oct 3, 2017

@srkunze See python/cpython@dc19c24832f, seems hard to workaround (depending on how much monkeypatchng @agronholm is wiling to accept).

@agronholm
Copy link
Owner

I can accept patches but first someone needs to explain what is going on and what must be done to fix this. I myself am short on time to delve into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants