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

Occasional exception: ValueError: Invalid file descriptor: -1 #57

Closed
davidosomething opened this issue Aug 17, 2017 · 6 comments
Closed

Comments

@davidosomething
Copy link

Exception ignored in: <bound method BaseEventLoop.__del__ of <_UnixSelectorEventLoop running=False closed=False debug=False>>
Traceback (most recent call last):
  File "/Users/davidosomething/.local/pyenv/versions/3.6.2/lib/python3.6/asyncio/base_events.py", line 512, in __del__
    self.close()
  File "/Users/davidosomething/.local/pyenv/versions/3.6.2/lib/python3.6/asyncio/unix_events.py", line 63, in close
    super().close()
  File "/Users/davidosomething/.local/pyenv/versions/3.6.2/lib/python3.6/asyncio/selector_events.py", line 110, in close
    self._close_self_pipe()
  File "/Users/davidosomething/.local/pyenv/versions/3.6.2/lib/python3.6/asyncio/selector_events.py", line 120, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
  File "/Users/davidosomething/.local/pyenv/versions/3.6.2/lib/python3.6/asyncio/selector_events.py", line 279, in _remove_reader
    key = self._selector.get_key(fd)
  File "/Users/davidosomething/.local/pyenv/versions/3.6.2/lib/python3.6/selectors.py", line 189, in get_key
    return mapping[fileobj]
  File "/Users/davidosomething/.local/pyenv/versions/3.6.2/lib/python3.6/selectors.py", line 70, in __getitem__
    fd = self._selector._fileobj_lookup(fileobj)
  File "/Users/davidosomething/.local/pyenv/versions/3.6.2/lib/python3.6/selectors.py", line 224, in _fileobj_lookup
    return _fileobj_to_fd(fileobj)
  File "/Users/davidosomething/.local/pyenv/versions/3.6.2/lib/python3.6/selectors.py", line 41, in _fileobj_to_fd
    raise ValueError("Invalid file descriptor: {}".format(fd))
ValueError: Invalid file descriptor: -1
@mhinz
Copy link
Owner

mhinz commented Sep 13, 2017

Repro steps?

I'm not even sure if the problem stems from neovim-remote, python-client or even asyncio.. hmm.

@mhinz
Copy link
Owner

mhinz commented Sep 30, 2017

I can't reproduce it, but it would be interesting to know if it still happens with the latest neovim-remote v1.8.4.

That version double-checks if a given Unix domain is valid by trying to connect to it first and using a temporary socket should that fail.

@mhinz
Copy link
Owner

mhinz commented Oct 7, 2017

Since there's nothing I can do about this without further information, I'm closing this.

Please reopen if you still think it's an issue in neovim-remote.

@mhinz mhinz closed this as completed Oct 7, 2017
@rudyryk
Copy link

rudyryk commented Jun 30, 2018

I get similar exception sometimes in the following case:

def sample_task(self, name: str, payload: dict):
    loop = asyncio.new_event_loop()
    coro = asyncio.sleep(1.0, loop=loop)
    result = loop.run_until_complete(coro)
    # loop.close()  # uncomment this line to avoid edge case with __del__
    return result

Looks like a kind of edge case with BaseEventLoop.__del__.

Note the line loop.close() before returning result. In my case solution was to close loop explicitly!

@mhinz
Copy link
Owner

mhinz commented Jun 30, 2018

@rudyryk

I don't use asyncio directly, python-client does. Do you use the latest version of python-client? pip3 list shows it as "neovim". I'm using 0.2.6.

It should been fixed as of neovim/pynvim#303, but maybe we missed a case.

@rudyryk
Copy link

rudyryk commented Jul 1, 2018

@mhinz I didn't use neovim actually, I just googled similar bug and thought it would be helpful :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants