[New-bugs-announce] [issue43264] Nested EventProxy in ListProxy cause FileNotFoundError: [Errno 2] No such file or directory problem

Tobiichi report at bugs.python.org
Fri Feb 19 03:55:42 EST 2021

New submission from Tobiichi <754785103 at qq.com>:

I append EventProxy into ListProxy like this:

l = manager.list([mp.Event() for _ in range(2)])

It works fine on a single node when I'm trying to get this listproxy. but when I trying to use multiple nodes across ethernet. it cause problem like this:

Traceback (most recent call last):
  File "client2.py", line 30, in <module>
  File "client2.py", line 18, in logic
    if l[i].is_set():
  File "<string>", line 2, in __getitem__
  File "/home/think/anaconda3/envs/AC/lib/python3.7/multiprocessing/managers.py", line 819, in _callmethod
    kind, result = conn.recv()
  File "/home/think/anaconda3/envs/AC/lib/python3.7/multiprocessing/connection.py", line 251, in recv
    return _ForkingPickler.loads(buf.getbuffer())
  File "/home/think/anaconda3/envs/AC/lib/python3.7/multiprocessing/managers.py", line 943, in RebuildProxy
    return func(token, serializer, incref=incref, **kwds)
  File "/home/think/anaconda3/envs/AC/lib/python3.7/multiprocessing/managers.py", line 793, in __init__
  File "/home/think/anaconda3/envs/AC/lib/python3.7/multiprocessing/managers.py", line 847, in _incref
    conn = self._Client(self._token.address, authkey=self._authkey)
  File "/home/think/anaconda3/envs/AC/lib/python3.7/multiprocessing/connection.py", line 492, in Client
    c = SocketClient(address)
  File "/home/think/anaconda3/envs/AC/lib/python3.7/multiprocessing/connection.py", line 620, in SocketClient

Nest ListProxy will cause same problem. like 

l = manager.list([manager.list([1 for _ in range(2)])for _ in range(2)])

Client act like this (manager in torch is SyncManager):

import torch.multiprocessing as mp

mp.current_process().authkey = b'abc'

def start_client(manager, host, port, key):
    manager.__init__(address=(host, port), authkey=key)
    return manager

def logic(manager):
    l = manager.get_list()
    for i in range(len(l)):
        if not l[i].is_set():

if __name__=='__main__':
    manager = mp.Manager()
    manager = start_client(manager, '', 5000, b'abc')

files: server.py
messages: 387295
nosy: show-me-code
priority: normal
severity: normal
status: open
title: Nested EventProxy in ListProxy cause FileNotFoundError: [Errno 2] No such file or directory problem
type: crash
versions: Python 3.6
Added file: https://bugs.python.org/file49819/server.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list