-
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
No lazy #2473
No lazy #2473
Conversation
As discussed in #2454, this code doesn't do what it claims to do on the surface, so we should delete it. I'll follow up with a commit to explain in the README how to actually defer loading of the plug-in.
Current coverage is 84.44% (diff: 100%)@@ master #2473 diff @@
==========================================
Files 17 17
Lines 1903 1903
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 1607 1607
Misses 296 296
Partials 0 0
|
Thanks for the PR! Review status: 0 of 2 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
@homu r=Valloric Reviewed 2 of 2 files at r1. Comments from Reviewable |
📌 Commit 7f76b03 has been approved by |
⚡ Test exempted - status |
No lazy # PR Prelude - [x] I have read and understood YCM's [CONTRIBUTING][cont] document. - [x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document. - [x] I have included tests for the changes in my PR. If not, I have included a rationale for why I haven't. - [x] **I understand my PR may be closed if it becomes obvious I didn't actually perform all of these steps.** # Why this change is necessary and useful See prior version of this PR (#2454) for more discussion. [cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md [code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2473) <!-- Reviewable:end -->
OK, I just reverted this PR because it was causing gvim (but not console vim) to become unresponsive on Linux. Repro steps:
@wincent If you could figure out what's going on and how we could have this change without making gvim unhappy, we'd be willing to merge a new version of the change. @micbou Thanks a bunch for noticing this! |
I don't have access to a Linux machine at this time, but if I can obtain access, I'll take a look. |
This is caused by a bad interaction between Python's import os
import subprocess
proc = subprocess.Popen( [ 'sleep', '1' ] )
pid = os.fork()
is_alive = proc.poll() is None
if pid:
print( 'Parent process: {0}'.format( is_alive ) )
else:
print( 'Child process: {0}'.format( is_alive ) ) It will output:
As you can see, the child process incorrectly returns that the
However, when loading YCM at In conclusion, I don't think we have much choice here; we can't load YCM at startup. |
@micbou as always a great analysis!
At least now we know :) |
Excellent explanation, @micbou. |
Don't use VimEnter initialization except when stating gui # PR Prelude - [x] I have read and understood YCM's [CONTRIBUTING][cont] document. - [x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document. - [x] I have included tests for the changes in my PR. If not, I have included a rationale for why I haven't. - [x] **I understand my PR may be closed if it becomes obvious I didn't actually perform all of these steps.** # Why this change is necessary and useful This is another attempt at: #2473 Which removed the apparently flawed attempt at "lazy" loading of YCM. While it fails to get the load out of the critical startup path, it *does* serve the useful purpose when starting up gvim of avoiding a deadlock situation in gvim. So, this time, we keep VimEnter, but only for the gui-starting case. We update the comment to explain what is actually happening. And we can keep the docs about how to defer loading. [cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md [code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2475) <!-- Reviewable:end -->
[READY] Use gui_running instead of gui to defer YCM loading at VimEnter `has('gui')` returns `1` even in console Vim if it is compiled with `+gui`. We should use `gui_running` instead. See 1d1a4f4#commitcomment-20876179. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2554) <!-- Reviewable:end -->
[READY] Always defer loading at VimEnter YCM should start the same whether Vim is running in GUI or not. Otherwise, this makes it difficult for other plugins to interact with YCM at startup because they can't predict how YCM will start unless they also check if Vim is running in GUI which is unreasonable. Since we can't load it at Vim startup because of [a deadlock issue](#2473 (comment)), we should always defer it at the VimEnter event. See discussion in 39659ca for more details. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2561) <!-- Reviewable:end -->
PR Prelude
rationale for why I haven't.
actually perform all of these steps.
Why this change is necessary and useful
See prior version of this PR (#2454) for more discussion.
This change is