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

Some time closing Goneovim take about 10 seconds #374

Closed
damanis opened this issue Jun 19, 2022 · 27 comments
Closed

Some time closing Goneovim take about 10 seconds #374

damanis opened this issue Jun 19, 2022 · 27 comments
Labels

Comments

@damanis
Copy link

damanis commented Jun 19, 2022

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

@akiyosi akiyosi added the bug label Jun 19, 2022
@akiyosi
Copy link
Owner

akiyosi commented Jun 19, 2022

@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.

@damanis
Copy link
Author

damanis commented Sep 9, 2022

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?

@akiyosi
Copy link
Owner

akiyosi commented Sep 10, 2022

@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

@damanis
Copy link
Author

damanis commented Sep 10, 2022

@akiyosi
FYI: minimap is disabled in my configuration.

@akiyosi
Copy link
Owner

akiyosi commented Sep 10, 2022

@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?

@damanis
Copy link
Author

damanis commented Sep 11, 2022

I had commented out full MiniMap section.
After set

[MiniMap]
Disable = true

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

@akiyosi
Copy link
Owner

akiyosi commented Sep 11, 2022

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

@damanis
Copy link
Author

damanis commented Sep 11, 2022

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

@damanis
Copy link
Author

damanis commented Sep 11, 2022

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

@akiyosi
Copy link
Owner

akiyosi commented Sep 11, 2022

@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?

@damanis
Copy link
Author

damanis commented Sep 12, 2022

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

@damanis
Copy link
Author

damanis commented Sep 12, 2022

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

@akiyosi
Copy link
Owner

akiyosi commented Sep 12, 2022

@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?

@damanis
Copy link
Author

damanis commented Sep 12, 2022

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
Copy link
Author

damanis commented Sep 13, 2022

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
Copy link
Author

damanis commented Sep 19, 2022

@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.

@akiyosi
Copy link
Owner

akiyosi commented Sep 19, 2022

@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?

@damanis
Copy link
Author

damanis commented Sep 19, 2022

@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
Copy link
Author

damanis commented Sep 19, 2022

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

@damanis
Copy link
Author

damanis commented Sep 22, 2022

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

@akiyosi
Copy link
Owner

akiyosi commented Sep 24, 2022

@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

@damanis
Copy link
Author

damanis commented Sep 24, 2022

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

@akiyosi
Copy link
Owner

akiyosi commented Sep 25, 2022

@damanis
NP!. Enjoy your vacation :)

@damanis
Copy link
Author

damanis commented Oct 12, 2022

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

@akiyosi
Copy link
Owner

akiyosi commented Oct 14, 2022

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

@damanis
Copy link
Author

damanis commented Oct 20, 2022

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

@akiyosi
Copy link
Owner

akiyosi commented Oct 20, 2022

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

@akiyosi akiyosi closed this as completed Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants