goneovim icon indicating copy to clipboard operation
goneovim copied to clipboard

Some time closing Goneovim take about 10 seconds

Open damanis opened this issue 2 years ago • 15 comments

To reproduce just run and quit (by ':q') goneovim. Usually, quit does not take any time, but one time of 5-6 times goneovim window stays open about 10 seconds. Note, that edited file is closed, only window is opened. Debug log (goneovim --debug=...) goneovim_debug.log

damanis avatar Jun 19 '22 04:06 damanis

@damanis Thanks for the report. I am experiencing this issue myself. It is not a high priority, but I will report any new findings in this issue.

akiyosi avatar Jun 19 '22 06:06 akiyosi

Processes when goneovim run:

  33544 ?        Sl     0:00 /home/sergey/go/src/github.com/akiyosi/goneovim/cmd/goneovim/deploy/linux/goneovim --nofork
  33554 ?        S      0:00 /tmp/.mount_nvim4XvPGZ/usr/bin/nvim --cmd let g:gonvim_running=1 --cmd let g:goneovim=1 --cmd set termguicolors --cmd let
  33557 ?        Ssl    0:00 nvim --cmd let g:gonvim_running=1 --cmd let g:goneovim=1 --cmd set termguicolors --cmd let &rtp.=',/home/sergey/go/src/gi
  33566 ?        S      0:00 /tmp/.mount_nvimOE4lDW/usr/bin/nvim -u NONE -n --embed --headless
  33569 ?        Ssl    0:00 nvim -u NONE -n --embed --headless
  33575 pts/2    R+     0:00 ps ax

Processes after ':q'

  33544 ?        Sl     0:00 /home/sergey/go/src/github.com/akiyosi/goneovim/cmd/goneovim/deploy/linux/goneovim --nofork
  33566 ?        S      0:00 /tmp/.mount_nvimOE4lDW/usr/bin/nvim -u NONE -n --embed --headless
  33569 ?        Ssl    0:00 nvim -u NONE -n --embed --headless
  33577 ?        S      0:00 /lib/systemd/systemd-udevd
  33580 pts/2    R+     0:00 ps ax

gdb session closed while goneovim window isn't closed yet.

Inferior 1 (process 33613) exited normally]
(gdb) bt
No stack.
(gdb)

So, main thread is closed properly. Seems, some goroutine still run, isn't it?

damanis avatar Sep 09 '22 18:09 damanis

@damanis Thanks. It is very helpful. It seems that the nvim process related to minimap viewer take long time for finishing. I will investigate based on the information

akiyosi avatar Sep 10 '22 01:09 akiyosi

@akiyosi FYI: minimap is disabled in my configuration.

damanis avatar Sep 10 '22 17:09 damanis

@damanis Hmmm, that is odd. If the minimap is disabled in settings.toml like this;

[MiniMap]
Disable = true

the nvim process will not start according to the minimap. But in your environment it does start?

akiyosi avatar Sep 10 '22 23:09 akiyosi

I had commented out full MiniMap section. After set

[MiniMap]
Disable = true

the ps ax | grep nvim output isn't changed.

damanis avatar Sep 11 '22 07:09 damanis

Hmmm, that is weird. If minimap is disable, then goneovim only starts the main nvim. Does goneovim restart after changing the settings?

akiyosi avatar Sep 11 '22 13:09 akiyosi

Sure. There are processes started by 'goneovim .bashrc': image

damanis avatar Sep 11 '22 15:09 damanis

To be sure: settings.toml in ~/.config/goneovim?

damanis avatar Sep 11 '22 16:09 damanis

@damanis Yes, the location of settings.toml is correct.

Why are there three processes associated with goneovim in the above image? Is it possible that a zombie process is included?

akiyosi avatar Sep 11 '22 22:09 akiyosi

@akiyosi There are no zombie processes. Exactly these four processes were ran by bash command 'goneovim .bashrc'. Do you get another list?

damanis avatar Sep 12 '22 05:09 damanis

@akiyosi Oh, sorry, the parameter is 'Disable'... Now I changed it to 'Disable = true'. image

damanis avatar Sep 12 '22 11:09 damanis

@damanis From the above image it appears that the process corresponding to minimap is no longer started. However, it appears that two processes are still being started. This is not expected by goenovim. It seems that nvim process under /tmp is being started, is this something specific to your environment?

akiyosi avatar Sep 12 '22 13:09 akiyosi

I'm using nvim.appimage. It same as docker and mount to /tmp some its parts. After I set

[MiniMap]
Disable = true

I didn't see the problem. Seems, it relates to minimap code.

Update. I got the problem with disabled minimap. ps ax | grep nvim output was empty (goneovim process still exists).

damanis avatar Sep 12 '22 13:09 damanis

I don't know if this is same problem. Sometimes the nvim processes, like first two on screenshot below, stay exist after goneovim window is closed until killed manually.

image

damanis avatar Sep 13 '22 12:09 damanis

@akiyosi I know why we have different 'ps ax' output when Goneovim runs. I used nvim.appimage - it runs more processes. After I installed nvim deb package only one nvim process started.

damanis avatar Sep 19 '22 06:09 damanis

@damanis Thanks for the info! Ah, so appimage behaves that way. I was not familiar with how appimage works. It was a good learning experience.

Regarding the issue you originally reported about the hang for a few seconds at the end of goneovim, I will continue to investigate the insufficiency of the nvim process which is responsible for minimap when it exits. Has the problem occurred since then after disabling minimap?

akiyosi avatar Sep 19 '22 06:09 akiyosi

@akiyosi Yes, I saw the problem with slow exit after disable minimap. Today I replaced appimage by deb package, so let's see if it will change something.

damanis avatar Sep 19 '22 07:09 damanis

@akiyosi Today i got slow exit (one time).

damanis avatar Sep 19 '22 13:09 damanis

Catch slow exit with minimap disabled: no nvim process, only goneovim process in 'ps ax' output.

damanis avatar Sep 22 '22 13:09 damanis

@damanis Thanks for the info. I have looked into the code that may be the possible cause of this issue. However, this issue is not 100% reproducible, so if you would like to test it in your environment, I would be happy to do so. You can get the binaries corresponding to the fixed code at the following CI job.

https://github.com/akiyosi/goneovim/actions/runs/3113312704

akiyosi avatar Sep 24 '22 01:09 akiyosi

@akiyosi I would test after I return from vacation. Next two weeks I will have Internet access, but no PC to check.

damanis avatar Sep 24 '22 18:09 damanis

@damanis NP!. Enjoy your vacation :)

akiyosi avatar Sep 25 '22 02:09 akiyosi

@akiyosi I'm testing provided image. The problem isn't seem yet; I'll update if it occurs. Or prefer take latest image?

damanis avatar Oct 12 '22 08:10 damanis

@damanis Thanks for confirming! There is no need to use the latest image.

akiyosi avatar Oct 14 '22 02:10 akiyosi

@akiyosi Last week I didn't see the slow exit. Will you merge the fix to master?

damanis avatar Oct 20 '22 05:10 damanis

@damanis Thanks! I will merge the branch and also close this issue for now. If the issue occurs again, please re-open it.

akiyosi avatar Oct 20 '22 05:10 akiyosi