-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[vim] massive file descriptors leak #4293
Comments
No description provided. |
Thanks for taking the time to look into this. Would you be willing to open a PR? Would be helpful to get some repro steps if you have them too. |
About steps to reproduce - sockets always leaks, as i understand, this can be reproduced with default settings while you move cursor up/down/left/right in one file with source code. Count of opened sockets in CLOSE_WAIT state will growing and (if standartl vim is used) these sockets never closed withoud vim restart - lsof show it. About PR - ok, i will try :) |
I did some additional investigation and found that I was wrong in point 1 of this issue description. Now all is done (PR is ready), and all sockets closing (with some delay, but it's normal, i think). |
I'm not sure, but looks like YouCompleteMe do not close sockets, and after some time vim lose ability to open files due to number of file descriptors limit per process. :)
As i understand, this problem is caused by 2 places:
this one: in this place YouCompleteMe create request wrapped into future but do not do anything with it and socket inside is never closed.- this is not right, and in this place python really close socket, but little bit later (when GC is come)and second one: in this place request_id is removed from internal plugin dictionary, but python side is not know about this, and another request wrapped into future is lost for forever, and this is real memory and socket leak place :)
In addition in this line
vim.eval( "request_id" )
should be replaced withint( vim.eval( "request_id" ) )
otherwise request_id will be passed as string into python (as i understand), and request will be not removed from internal ycm dictionary.Vim and neovim handle plugins with different ways, and looks like for neovim this problem is not fatal. But original vim after some time reaches number of opened fd limit and stop working; only relaunch is help, but sometimes it's annoying :(
My vim version is:
And OS:
The text was updated successfully, but these errors were encountered: