Open a1994846931931 opened 5 years ago
@a1994846931931 thanks for the reporting? Do you want to have a look at it?
@a1994846931931 thanks for the reporting? Do you want to have a look at it?
Yes, sure. Don't know what I can do, but I'm working on it.
Yes, sure. Don't know what I can do, but I'm working on it.
oh, me neither, it needs some debugging, but pretty sure that you will figure it out
Diagnostics Update: The problem is caused by that the language server is not correctly shut down, and it would relaunch 4 times when it's killed. The correct way to have it shut down is to call the plugin's "deactivate" function. But theia currently doesn't call the "deactivate" function when it exists.
Could you try to revert https://github.com/theia-ide/theia/commit/797db759bcdde66c8bbabf2ab0b041bc7d887d30 and see whether it helps?
My assumption is that main process exits without terminating the plugin host process properly at all.
@akosyakov Hi! I added the line this.hostedPluginProcess.terminatePluginServer();
back here,
https://github.com/theia-ide/theia/blob/797db759bcdde66c8bbabf2ab0b041bc7d887d30/packages/plugin-ext/src/hosted/node/hosted-plugin.ts#L90-L92
so that it becomes
private terminatePluginServer(): void {
this.hostedPluginProcess.terminatePluginServer();
this.hostedPluginProcess.markPluginServerTerminated();
}
but it doesn't work. It seems that function terminatePluginServer
in HostedPluginSupport
isn't called at all, when theia exists.
Usually we follow the pattern that a child process listen to whether parent process exists, if it does not then it exits as well, gracefully. We need to apply it for the plugin system as well. @theia-ide/plugin-system Is there any concerns?
@akosyakov the approach is OK for a local plugin host process, but in Che we run plugin host processes remotely. Maybe an approach detecting connection loss would work better accross both scenarios?
@tsmaeder I thought you run Theia instance in each side container which spawns the plugin host process?
We run a "partial" theia instance, but that just bumps the problem up to that theia instance: when does it go away? Btw: what does "stop Theia" mean in that instance? Killing the back end or closing a browser window?
It means when Theia instance (backend) is terminated somehow. I think in your case it would be also useful to terminate the plugin host process gracefully if "partial" theia instance is gone.
Description
VSCode's C/C++ plugin is working pretty well on theia now. But if one stops theia and then relaunch it, an error will be shown which says
and the plugin will not work at all. I can only have it work again either by removing
/tmp/vscode-unpacked/cpptools-linux.vsix
folder or by killing all the related plugin processes that run in the background even after theia is stopped.Reproduction Steps
"@theia/cpp": "^0.9.0",
dependency fromexamples/browser/package.json
and compile theiaplugins
folderps aux | grep CPP
(linux)NOTE: Step 4 is necessary. If no C/C++ project is opened, the language server will stop as expected.
OS and Theia version: Ubuntu 18.04 Theia 66976d0f29064f36f02d0090040828848da1a79e
Diagnostics: No further diagnostic is available currently.