Skip to content
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

GH-835: Made sure forked process is terminated on application quit. #836

Merged
merged 1 commit into from
Nov 16, 2017

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Nov 15, 2017

Adjusted server worker log messages, logged PID too.

Closes #835.

Signed-off-by: Akos Kitta kittaakos@gmail.com

@kittaakos kittaakos changed the title [WIP] GH-835: Made sure forked process is terminated on application quit. GH-835: Made sure forked process is terminated on application quit. Nov 15, 2017
// If we forked the process for the clusters, we need to manually terminate it.
// See: https://github.com/theia-ide/theia/issues/835
process.kill(cp.pid);
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed the semicolon here. :(

Adjusted server worker log messages, logged PID too.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
Copy link

@hexa00 hexa00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM assuming it works on the 3 paltforms...

@kittaakos
Copy link
Contributor Author

I have verified the changes on OS X with some trick from here. It fixes the issue.

The application works, but it does not fix anything on Windows. The LS process is a different store. I still need to verify one more use case on Ubuntu.

@kittaakos
Copy link
Contributor Author

store

I meant: "story".

@kittaakos
Copy link
Contributor Author

Something is odd. I can select a WS root, but then I cannot change. I do not know whether it is related to my change or not. I will update this thread.

@kittaakos
Copy link
Contributor Author

Something is odd. I can select a WS root, but then I cannot change. I do not know whether it is related to my change or not. I will update this thread.

#838

@@ -120,6 +120,11 @@ if (cluster.isMaster) {
console.error(error);
electron.app.exit(1);
});
electron.app.on('quit', function() {
// If we forked the process for the clusters, we need to manually terminate it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder is it the same when cluster forks, should we clean up for them too? Right now electron process -> master process -> worker process -> ls process. This change kills the master process. But if the worker process is still running, when the ls process won’t auto shutdown itself according the lsp.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. I had the same feeling. But I would like to tackle that as part of #815. I plan to proceed with smaller changes and verify them one by one on each platform with the bundled electron application.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point is that probably nothing should be done about ls servers, only workers should be killed, and ls processes will exit according to the lsp.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. We'll see how that works in practice, especially on Windows in the context of #815.

@kittaakos kittaakos merged commit 2ceb174 into master Nov 16, 2017
@kittaakos kittaakos deleted the GH-835 branch November 16, 2017 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants