roxma / nvim-yarp

Yet Another Remote Plugin Framework for Neovim
MIT License
229 stars 14 forks source link

"[deoplete@yarp] Exception ignored in:" after recent yarp change #15

Closed mrbiggfoot closed 6 years ago

mrbiggfoot commented 6 years ago

Problem: after updating yarp plugin, start vim with deoplete, then exit it using ":qa!". There's a good chance that you will see this:

[deoplete@yarp] Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in:

Does not happen every time but quite often. The count of "Exception ignored in:" can vary. The yarp commit that causes it is this:

commit 1e53a01493ab41c6bd82737571826c9b378d8b0e
Author: roxma <roxma@qq.com>
Date:   Thu Jun 28 23:31:17 2018 +0800

    Add yarp#core#try_notify

    yarp.py

        - environ['NVIM_YARP_MODULE'] = module
        - assert __name__ == "__main__"

    autoload/yarp/core.vim

        - add yarp#core#try_notify()
        - unlet mod.channel in yarp#core#on_exit

I'm not sure whether it is a yarp or deoplete problem, so CC'ing @Shougo.

poslegm commented 6 years ago

I have similar problem. After exiting vim with q! I see this:

[deoplete@yarp] Exception ignored in: <bound method BaseSubprocessTransport.__del__ of <_UnixSubpr
ocessTransport closed pid=7462 running stdin=<_UnixWritePipeTransport closing fd=15 open> stdout=<
_UnixReadPipeTransport fd=16 open>>>
[deoplete@yarp] Traceback (most recent call last):
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/base_subprocess.py", line 132, in __del__
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/base_subprocess.py", line 106, in close
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/unix_events.py", line 624, in close
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/unix_events.py", line 610, in write_eof
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/base_events.py", line 575, in call_soon
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/base_events.py", line 358, in _check_closed
[deoplete@yarp] RuntimeError: Event loop is closed
[deoplete@yarp] Exception ignored in: <bound method BaseSubprocessTransport.__del__ of <_UnixSubpr
ocessTransport closed pid=7451 running stdin=<_UnixWritePipeTransport closing fd=13 open> stdout=<
_UnixReadPipeTransport fd=14 open>>>
[deoplete@yarp] Traceback (most recent call last):
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/base_subprocess.py", line 132, in __del__
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/base_subprocess.py", line 106, in close
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/unix_events.py", line 624, in close
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/unix_events.py", line 610, in write_eof
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/base_events.py", line 575, in call_soon
[deoplete@yarp]   File "/usr/lib/python3.6/asyncio/base_events.py", line 358, in _check_closed
[deoplete@yarp] RuntimeError: Event loop is closed
[deoplete@yarp] Exception ignored in: <bound method BaseSubprocessTransport.__del__ of <_UnixSubpr
ocessTransport closed pid=7447 running stdin=<_UnixWritePipeTransport closing fd=11 open> stdout=<
_UnixReadPipeTransport fd=12 open>>>
[deoplete@yarp] Traceback (most recent call last):

But exit with file save (wq) works good.

roxma commented 6 years ago

I cannot reproduce the issue

I need more information, vim8 version, os environment, minimal vimrc and reproducing steps

poslegm commented 6 years ago

@roxma unfortunately your PR not helped for me. And after installing it I have [deoplete@yarp] Exception: method deoplete_init not found message on vim startup.

Vim version: 8.1.22 OS: Arch Linux Minimal .vimrc:

call plug#begin('~/.vim/plugged')
" ============= Vim-Plug begin ===============
if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
endif
" =============== Vim-Plug end ===============
call plug#end()
let g:deoplete#enable_at_startup = 1

Reproducing steps:

  1. Open vim: vim .vimrc
  2. Type :q!
roxma commented 6 years ago

I've push an update, please try the latest version

poslegm commented 6 years ago

@roxma latest version of your PR don't solve this issue.

But I found the cause of the problem. In file autoload/yarp/core.vim you moved code block

if has_key(self, 'job')
    return
endif

to the beginning of the function yarp#core#jobstart. I returned it to its original position and the errors was gone.

сс @mrbiggfoot

mrbiggfoot commented 6 years ago

Works for me now, thanks everyone!