This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ListProxy with EventProxy in caused FileNotFoundError: [Errno 2] No such file or directory problem
Type: behavior Stage:
Components: Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: iritkatriel, show-me-code
Priority: normal Keywords:

Created on 2021-02-19 08:55 by show-me-code, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
server.py show-me-code, 2021-02-19 08:55 this is the server file which initize list
client1.py show-me-code, 2021-02-19 08:56 client file which use list created in server
Messages (2)
msg387295 - (view) Author: Tobiichi (show-me-code) Date: 2021-02-19 08:55
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>
    logic(manager)
  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__
    self._incref()
  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
    s.connect(address)
```

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.register('get_list')
    manager.__init__(address=(host, port), authkey=key)
    manager.connect()
    return manager

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

if __name__=='__main__':
    manager = mp.Manager()
    manager = start_client(manager, '127.0.0.1', 5000, b'abc')
    logic(manager)
```
msg404231 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-10-18 22:09
Changing type as crash typically refers to segfault or hang and not exception.
History
Date User Action Args
2022-04-11 14:59:41adminsetgithub: 87430
2021-10-18 22:09:59iritkatrielsettype: crash -> behavior

messages: + msg404231
nosy: + iritkatriel
2021-02-19 09:02:16show-me-codesettitle: Nested EventProxy in ListProxy cause FileNotFoundError: [Errno 2] No such file or directory problem -> ListProxy with EventProxy in caused FileNotFoundError: [Errno 2] No such file or directory problem
2021-02-19 08:56:44show-me-codesetfiles: + client1.py
2021-02-19 08:55:42show-me-codecreate