eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.06k stars 2.5k forks source link

[process] On Linux, when Theia is closed from the UI, its process is not killed #5644

Open federicobozzini opened 5 years ago

federicobozzini commented 5 years ago

Description

On Linux, when Theia is run from the terminal and the application gets closed by the user from the UI, the Theia process is kept alive. `Ctrl C` is needed to kill the process. ### Reproduction Steps

Try to compile and run Theia on desktop (on Linux) by using yarn start and then click on the X icon to close the program. The process in the Terminal is not killed.

OS and Theia version:

Diagnostics:

Not sure if referred to the main Theia process or to subprocess but this is the output printed when Theia gets closed from the UI:

process WARN This process was not registered or was already unregistered. [ID: 0]

akosyakov commented 5 years ago

Electron? in browser it does not make sense to kill the server.

federicobozzini commented 5 years ago

Yes exactly, with the electron version.

akosyakov commented 5 years ago

I've marked as a bug, but someone needs to verify whether it is a case. @kittaakos ?

kittaakos commented 5 years ago

electron version.

@federicobozzini, was it a bundled electron application or you have started the electron example from the terminal?

federicobozzini commented 5 years ago

The latter, the electron example run from the terminal.

kittaakos commented 5 years ago

Thanks for the update. We have to check whether the same happens with a bundled application too.

kittaakos commented 5 years ago

We have to check whether the same happens with a bundled application too.

No; it works.

kittaakos@ubuntu:~/dev/theia-apps/theia-electron/dist/linux-unpacked$ ./theia-electron 
root INFO Theia app listening on http://localhost:46857.
root INFO Git askpass helper is listening on http://127.0.0.1:43581.
root INFO Using Git [2.22.0] from the PATH. (/usr/bin/git)
root WARN Collided keybinding is ignored;  {"command":"outlineView:toggle","keybinding":"ctrlcmd+shift+s"}  collided with  {"command":"file.saveAs","keybinding":"ctrl+shift+s"}
root WARN Could not register keybinding:
  {"command":"outlineView:toggle","keybinding":"ctrlcmd+shift+s"}
Error: "ctrlcmd+shift+s" is in collision with something else [scope:0]
root WARN Collided keybinding is ignored;  {"command":"passthrough","keybinding":"ctrl+k","context":"terminalActive"}  collided with  {"command":"terminal:clear","keybinding":"ctrlcmd+k","context":"terminalActive"}
root WARN Could not register keybinding:
  {"command":"passthrough","keybinding":"ctrl+k","context":"terminalActive"}
Error: "ctrl+k" is in collision with something else [scope:0]
root WARN e.onStart is slow, took: 229.99999999956344 ms
root INFO [nsfw-watcher: 67759] Started watching: /home/kittaakos/.theia
root INFO [nsfw-watcher: 67759] Started watching: /home/kittaakos/.theia
root INFO [nsfw-watcher: 67759] Stopped watching: /home/kittaakos/.theia
root WARN e.onStart is slow, took: 702.1999999997206 ms
root INFO Checking whether '--no-optional-locks' can be used with the current Git executable. Minimum required version is '2.15.0'.
root INFO '--no-optional-locks' is a valid Git option for the current Git version: '2.22.0'.
root INFO Started watching the git repository: file:///home/kittaakos/.nvm
root INFO Config file tasks.json does not exist under file:///home/kittaakos
kittaakos@ubuntu:~/dev/theia-apps/theia-electron/dist/linux-unpacked$

It's not the best for sure, but it works from the bundled application.

arekzaluski commented 5 years ago

@kittaakos I confirm that it works correctly for bundled Theia on Linux. For some reason https://github.com/theia-ide/theia-apps/tree/master/theia-electron was failing to build for me so I quickly added electron-builder to master of theia and generated AppImage installer. Closing windows in AppImage is killing all Theia processes correclty. I confirm however that this issue exists in development.

kittaakos commented 5 years ago

was failing to build for

I had memory issues as well. I had to build and package with:

NODE_OPTIONS=--max_old_space_size=4096 yarn build

Closing windows in AppImage is killing all Theia processes correclty. I confirm however that this issue exists in development.

I experienced the exact same behavior. Thank you for verifying it, @arekzaluski.