celery / billiard

Multiprocessing Pool Extensions
Other
411 stars 249 forks source link

forkserver start method not available #200

Open jakirkham opened 7 years ago

jakirkham commented 7 years ago

I seem to be seeing this error on Python 2.7 on my OS X 10.9. It appears forkserver is not supported. 😕 First is this a bug or an intentional omission? Second if the latter, is there any plan for adding support for forkserver?

>>> import billiard
>>> billiard.get_context("forkserver")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/zopt/conda2/envs/nanshenv/lib/python2.7/site-packages/billiard/context.py", line 292, in get_context
    return super(DefaultContext, self).get_context(method)
  File "/zopt/conda2/envs/nanshenv/lib/python2.7/site-packages/billiard/context.py", line 241, in get_context
    ctx._check_available()
  File "/zopt/conda2/envs/nanshenv/lib/python2.7/site-packages/billiard/context.py", line 366, in _check_available
    raise ValueError('forkserver start method not available')
ValueError: forkserver start method not available
jakirkham commented 7 years ago

These lines seem relevant. Seems that rules this out from working on Python 2.

pitrou commented 7 years ago

What's really relevant is sendmsg() / recvmsg() support, in order to send file descriptors from one process to another: https://github.com/celery/billiard/blob/v3.5.0.1/billiard/reduction.py#L178-L212

pitrou commented 7 years ago

Answering to comment on the distributed bug tracker: backporting socket is probably quite adventurous. It would be more reasonable to only backport sendmsg and recvmsg...

Actually, similar functionality was already uploaded to PyPI: https://pypi.python.org/pypi?%3Aaction=search&term=sendmsg&submit=search