-
Notifications
You must be signed in to change notification settings - Fork 770
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
[READY] Prevent simultaneous starts of OmniSharp server #310
Conversation
Use ServerIsActive instead of ServerIsRunning in OnFileReadyToParse to start the server. Poll the process in ServerIsActive. Improve logic in ServerIsRunning and ServerIsReady methods.
Review status: 0 of 1 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. ycmd/completers/cs/cs_completer.py, line 235 [r1] (raw file): ycmd/completers/cs/cs_completer.py, line 555 [r1] (raw file): In fact, the wrapper can also handle popen handle being None too, so this check only returns the value from the helper func. Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r1. ycmd/completers/cs/cs_completer.py, line 231 [r1] (raw file): Comments from the review on Reviewable.io |
Review status: 0 of 3 files reviewed at latest revision, 3 unresolved discussions. ycmd/completers/cs/cs_completer.py, line 231 [r1] (raw file): ycmd/completers/cs/cs_completer.py, line 235 [r1] (raw file): ycmd/completers/cs/cs_completer.py, line 555 [r1] (raw file): Comments from the review on Reviewable.io |
Reviewed 3 of 3 files at r2. ycmd/completers/javascript/tern_completer.py, line 443 [r2] (raw file): This must mean we're not covering this in the tests? :/ Comments from the review on Reviewable.io |
Review status: 2 of 3 files reviewed at latest revision, 4 unresolved discussions. ycmd/completers/javascript/tern_completer.py, line 443 [r2] (raw file): Comments from the review on Reviewable.io |
LGTM assuming the tests pass :) Reviewed 1 of 1 files at r3. ycmd/completers/javascript/tern_completer.py, line 443 [r2] (raw file): Comments from the review on Reviewable.io |
Reviewed 2 of 3 files at r2, 1 of 1 files at r3. Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. ycmd/completers/cs/cs_completer.py, line 585 [r3] (raw file): Comments from the review on Reviewable.io |
ServerTerminated is the inverse of ServerIsActive so we remove one and use the other instead.
Review status: 2 of 4 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. ycmd/completers/cs/cs_completer.py, line 585 [r3] (raw file): Comments from the review on Reviewable.io |
I still see [WIP] in the issue heading. Is there some work still pending? Review status: 2 of 4 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. Comments from the review on Reviewable.io |
Reviewed 2 of 2 files at r4. Comments from the review on Reviewable.io |
Yes, I changed the name of Review status: 2 of 5 files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
Reviewed 3 of 3 files at r5. Comments from the review on Reviewable.io |
Reviewed 3 of 3 files at r5. Comments from the review on Reviewable.io |
bbb7cbf
to
0834055
Compare
Rename ServerIs* methods to correspond to ycmd handlers /healthy and /ready. Rename ServerIsActive to ServerIsRunning. Simplify these methods by removing the request_data parameter, which is never used.
All good, thank you! :) @homu r+ Reviewed 1 of 3 files at r2, 1 of 1 files at r3, 2 of 3 files at r5, 1 of 1 files at r6. Comments from the review on Reviewable.io |
📌 Commit 940448a has been approved by |
[READY] Prevent simultaneous starts of OmniSharp server Currently, C# completer starts a new server on the `FileReadyToParse` event if no port is defined or the running server does not respond. This can lead to situations where multiple servers with same port and solution are started until one of them become ready. See PR #284 and ycm-core/YouCompleteMe#1913. This is fixed by using `ServerIsActive` instead of `ServerIsRunning` to start the server in `OnFileReadyToParse`. We then check `ServerIsRunning` for an early return. `ServerIsActive` is updated to check the handle (instead of the port) and to poll the process. We cannot only rely on the port because it can be defined while the process is down: server crashed during start up or its process was directly terminated by the user. `ServerIsRunning` and `ServerIsReady` are also changed. We return early in both methods by checking `ServerIsAlive` first and we restrict exceptions catching. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/310) <!-- Reviewable:end -->
☀️ Test successful - status |
Currently, C# completer starts a new server on the
FileReadyToParse
event if no port is defined or the running server does not respond. This can lead to situations where multiple servers with same port and solution are started until one of them become ready. See PR #284 and ycm-core/YouCompleteMe#1913.This is fixed by using
ServerIsActive
instead ofServerIsRunning
to start the server inOnFileReadyToParse
. We then checkServerIsRunning
for an early return.ServerIsActive
is updated to check the handle (instead of the port) and to poll the process. We cannot only rely on the port because it can be defined while the process is down: server crashed during start up or its process was directly terminated by the user.ServerIsRunning
andServerIsReady
are also changed. We return early in both methods by checkingServerIsAlive
first and we restrict exceptions catching.