[pypy-issue] Issue #2841: Remote Multprocessing Issue (pypy/pypy)

Amaury Rolin issues-reply at bitbucket.org
Wed May 30 14:54:24 EDT 2018


New issue 2841: Remote Multprocessing Issue
https://bitbucket.org/pypy/pypy/issues/2841/remote-multprocessing-issue

Amaury Rolin:

I am trying to run the [remote manager example code](https://docs.python.org/3/library/multiprocessing.html#using-a-remote-manager) remote manager example code from the multiprocessing documentation in pypy3 but I get an error connecting the client.

Server side:
```
#!python

from multiprocessing.managers import BaseManager
from queue import Queue
queue = Queue()
class QueueManager(BaseManager): pass
QueueManager.register('get_queue', callable=lambda:queue)
m = QueueManager(address=('127.0.0.1', 50000), authkey=b'abracadabra')
s = m.get_server()
s.serve_forever()
```

Client side:
```
#!python
from multiprocessing.managers import BaseManager
class QueueManager(BaseManager): pass
QueueManager.register('get_queue')
m = QueueManager(address=('127.0.0.1', 50000), authkey=b'abracadabra')
m.connect()
queue = m.get_queue()
queue.put('hello')
```


Error when running pypy client:
```
#!python

Traceback (most recent call last):  
  File "C:/temp/testpypy/mp_client.py", line 7, in <module>  m.connect()
  File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\managers.py", line 455, in connect
   conn = Client(self._address, authkey=self._authkey)
  File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\connection.py", line 493, in Client
    answer_challenge(c, authkey)
  File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\connection.py", line 732, in answer_challenge
    message = connection.recv_bytes(256)         # reject large message
  File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\connection.py", line 216, in recv_bytes
    buf = self._recv_bytes(maxlength)
  File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\connection.py", line 407, in _recv_bytes
    buf = self._recv(4)
  File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\connection.py", line 386, in _recv
    buf.write(chunk)
TypeError: 'str' does not support the buffer interface
```

if I try to connect to it from a CPython interpreter (which is my ultimate goal) I get the following error:
```
#!python

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python\3.5.4.2\WinPython\python-3.5.4.amd64\lib\multiprocessing\managers.py", line 455, in connect
     conn = Client(self._address, authkey=self._authkey)
  File "c:\Python\3.5.4.2\WinPython\python-3.5.4.amd64\lib\multiprocessing\connection.py", line 493, in Client
     answer_challenge(c, authkey)
  File "c:\Python\3.5.4.2\WinPython\python-3.5.4.amd64\lib\multiprocessing\connection.py", line 737, in answer_challenge
     response = connection.recv_bytes(256)        # reject large message
  File "c:\Python\3.5.4.2\WinPython\python-3.5.4.amd64\lib\multiprocessing\connection.py", line 218, in recv_bytes
     self._bad_message_length()
  File "c:\Python\3.5.4.2\WinPython\python-3.5.4.amd64\lib\multiprocessing\connection.py", line 151, in _bad_message_length
     raise OSError("bad message length")
OSError: bad message length
```

I tried this with the latest build PyPy3 build and the 6.0 release. This works in PyPy 2.7.




More information about the pypy-issue mailing list