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

Terminate IDEs gracefully on workspace shutdown #10123

Merged
merged 1 commit into from
May 20, 2022
Merged

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented May 19, 2022

Description

Terminate IDEs gracefully on workspace shutdown.

Before this PR, we will send Interrupt (SIGINT) to ask IDEs to exit, and only give them 5 seconds to do it. This behavior may cause IDEs indexing failed sometimes.

To properly shutdown IDE server

  • Increase time to force shutdown to 15 seconds
  • For code we use these enable-remote-auto-shutdown and remote-auto-shutdown-without-delay args we pass SIGTERM
  • For Gateway we use exit command

Related Issue(s)

Fixes #9955

How to test

For Gateway

With ws.log we must see asked IDE to terminate before IDE stopped, exiting
With downloaded zipped log, unzip and unzip .zip file inside, you will get idea.log, and check indexing logs inside

image

Release Notes

Terminate IDEs gracefully on workspace shutdown

Documentation

@jeanp413
Copy link
Member

@mustard-mh Be sure to check if remote-auto-shutdown-without-delay is helpful or not, from what I've read in the code it will terminate the server immediately after closing the browser tab which may not be desired if user closed it by accident. Also check if it's possible to dispose the front-end workbench properly after the 30 min timeout

@akosyakov
Copy link
Member

@mustard-mh yes it will be good to have how to test section fro VS Code as well

@mustard-mh
Copy link
Contributor Author

mustard-mh commented May 20, 2022

@mustard-mh yes it will be good to have how to test section for VS Code as well

I don't know how to reproduce it [1], so don't know how to test it🥲 @akosyakov

@akosyakov
Copy link
Member

akosyakov commented May 20, 2022

I don't know how to reproduce it #9955 (comment), so don't know how to test it🥲 @akosyakov

Could you take time to read through VS Code code and understand meaning of this options and how we can test?

@akosyakov
Copy link
Member

akosyakov commented May 20, 2022

I don’t think enable-remote-auto-shutdown is useful for us. The extension host is a process which runs VS Code extensions for a given window. If we enable enable-remote-auto-shutdown then a server will be shutdown after all windows are gone and there is no new windows within 5 mins. We don’t need this logic. We already handle it on level of workspaces and VS Code Server lifetime is bound to a workspace lifetime for us.

SIGTERM should work instead better and wait like 5s.

Copy link
Contributor

@felladrin felladrin left a comment

Choose a reason for hiding this comment

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

Code reviewed and PR tested as described. Everything working fine! ✅

@roboquat roboquat merged commit 4e68dcb into main May 20, 2022
@roboquat roboquat deleted the hw/ide-term-2 branch May 20, 2022 12:04
@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed Change is completely running in production release-note size/M team: IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terminate IDEs gracefully on workspace shutdown
5 participants