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

ListProxy with EventProxy in caused FileNotFoundError: [Errno 2] No such file or directory problem #87430

Open
show-me-code mannequin opened this issue Feb 19, 2021 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@show-me-code
Copy link
Mannequin

show-me-code mannequin commented Feb 19, 2021

BPO 43264
Nosy @iritkatriel, @show-me-code
Files
  • server.py: this is the server file which initize list
  • client1.py: client file which use list created in server
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2021-02-19.08:55:42.000>
    labels = ['type-bug']
    title = 'ListProxy with EventProxy in caused FileNotFoundError: [Errno 2] No such file or directory problem'
    updated_at = <Date 2021-10-18.22:09:59.416>
    user = 'https://github.com/show-me-code'

    bugs.python.org fields:

    activity = <Date 2021-10-18.22:09:59.416>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2021-02-19.08:55:42.000>
    creator = 'show-me-code'
    dependencies = []
    files = ['49819', '49820']
    hgrepos = []
    issue_num = 43264
    keywords = []
    message_count = 2.0
    messages = ['387295', '404231']
    nosy_count = 2.0
    nosy_names = ['iritkatriel', 'show-me-code']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue43264'
    versions = ['Python 3.6']

    @show-me-code
    Copy link
    Mannequin Author

    show-me-code mannequin commented Feb 19, 2021

    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)
    

    @show-me-code show-me-code mannequin added type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 19, 2021
    @show-me-code show-me-code mannequin changed the title 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 Feb 19, 2021
    @show-me-code show-me-code mannequin changed the title 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 Feb 19, 2021
    @iritkatriel
    Copy link
    Member

    Changing type as crash typically refers to segfault or hang and not exception.

    @iritkatriel iritkatriel added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Oct 18, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @iritkatriel iritkatriel added the stdlib Python modules in the Lib dir label Nov 28, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant