[lsp] Exiting vscode causes openHAB java process to exit #6291
Comments
What does that exactly mean? Afaik, Java only exists silently, if |
Uh, wow, I can indeed reproduce it. Not by closing VSCode (openHAB keeps running), but by closing the folder in VS Code. Indeed, a sudden death :-/ |
FTR: Running
from Oracle on a Mac. |
Right, in my case, either closing the folder, or exiting VS Code causes the issue. |
It truly is silent. Nothing logged in any of the OH log files, nothing in syslog, and nothing logged to stdout (when run from a shell using start.sh). |
Might be related to this discussion: eclipse-lsp4j/lsp4j#161 |
Oh my! :-o Edit: That code snippet in the issue you referenced certainly explains why it's silent... |
I had a look into the code of This implementation follows the LSP specification of the "exit" request (https://microsoft.github.io/language-server-protocol/specification#exit):
|
I have created eclipse/xtext-core#885 for discussion and will check out if I can find a workaround for the time being. |
FTR, I have created openhab/openhab-core#409, which works around the issue in my tests. Not 100% sure it works in all cases as I also saw once a message in VS Code after re-connecting that the LSP server cannot respond as it is being shut down (since according to the spec this is a two step process (shutdown->exit)). I could not reproduce it again, though, so let's first try our luck with that workaround. |
@kaikreuzer I see more people reporting "random OH restarts", which could be caused by the xtext issue referenced above. It looks like openHAB core hasn't been built in a while. As it contains your workaround to this issue, could you kick off a build of openHAB core so that it gets included in the next OH build? Thanks! |
@mhilbush It is already included in the snapshot since a few days - it is built with openhab-bundles build, openhab-core build plan is not needed. |
I updated to SNAPSHOT 2.4.0~20181001112604-1 (Build #1378) on October 2. Does this build contain the work-around for the VS Code "exit" issue? I can report that with this OH build, when I exit VS Code, OH goes through a hard restart. I'm also dealing with MQTTITUDE having been moved to legacy status in the 2.4.0M4 milestone. I have not had time yet to migrate to using GPSTracker... so I need to continue using MQTTITUDE for the time being. According to what I read, to continue to use this OH1 binding, I had to add it to addons.cfg. The problem is, when OH stops (as when VS Code causes if to "crash"), all of my bindings get uninstalled (I found this - https://community.openhab.org/t/reinstall-bindings-after-restart-oh2/18945/6). So, the VS Code issue is really painful. Of course, if I'm doing something wrong (either with VS Code or with OH1 bindings), I'm WIDE open to being steered in the right direction ;-) Regards. Mike |
Then it does not contain it ;-) Afaik, it's only included in builds from Oct 2 onwards. Wrt mqttitude, please do not go off-topic here, but rather ask those questions at https://community.openhab.org/. Thanks! |
This post, dated Oct. 1 is the reason I wasn't sure if I had a "late enough" build. I guess by the time your workaround was reviewed and merged, the workaround didn't make it until and October 2 build. I was trying to avoid an OH restart (i.e., going through a SNAPSHOT update) due to the OH1 binding issue.
I was more mentioning it because of the extent of the problem the VS Code issue is causing... but yes, I was fishing for a resolution ;-) I'll post over on the OH Community ;-) Regards. Mike |
@kaikreuzer Can you provide me some info when a new testing release will be released? I'm using the Milestone builds and I don't want to change to snapshots. Thanks! |
I see the long-term fix has been added to xtext-core, and is in the 2.16.0.M3 release. I don't know when the final 2.16.0 release is planned, but hopefully the timing will work out and the next openHAB xtext upgrade will pick this up. |
Xtext 2.17 allows for configuring the LanguageServer exit behavior so the SecurityManager workaround can be removed. Fixes: eclipse-archived/smarthome#6291 Undos: openhab#409 See also: * "Configurable Server Exit Behavior" in the Xtext 2.16.0 release notes: https://www.eclipse.org/Xtext/releasenotes.html#/releasenotes/2018/12/04/version-2-16-0 * eclipse/xtext-core#885 Signed-off-by: Wouter Born <github@maindrain.net>
Xtext 2.17 allows for configuring the LanguageServer exit behavior so the SecurityManager workaround can be removed. Fixes: eclipse-archived/smarthome#6291 Undos: #409 See also: * "Configurable Server Exit Behavior" in the Xtext 2.16.0 release notes: https://www.eclipse.org/Xtext/releasenotes.html#/releasenotes/2018/12/04/version-2-16-0 * eclipse/xtext-core#885 Signed-off-by: Wouter Born <github@maindrain.net>
Xtext 2.17 allows for configuring the LanguageServer exit behavior so the SecurityManager workaround can be removed. Fixes: eclipse-archived/smarthome#6291 Undos: openhab#409 See also: * "Configurable Server Exit Behavior" in the Xtext 2.16.0 release notes: https://www.eclipse.org/Xtext/releasenotes.html#/releasenotes/2018/12/04/version-2-16-0 * eclipse/xtext-core#885 Signed-off-by: Wouter Born <github@maindrain.net> GitOrigin-RevId: fb972f3
See discussion here.
https://community.openhab.org/t/lsp-in-vs-code-causes-openhab-restart/52439/5
What I’m seeing on OH build 1372 is that the openHAB Java process exits silently when VS Code is closed, or when you close the conf folder in VS Code (which likely has the same effect as closing VS Code).
I’m not seeing this behavior on 1368.
I put the following LSP bundles in TRACE mode to see if I could capture indication of what might be happening. Nothing was logged when I exited VS Code .
In the interest of full disclosure, I’m running OpenJDK.
Edit: I'm seeing this on three different OH installations, all of which are running 1372 or later.
The text was updated successfully, but these errors were encountered: