-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[JetBrains] Avoid shutting down terminals when closing the client #15527
Merged
roboquat
merged 1 commit into
main
from
felladrin/avoid-shutting-down-terminals-when-exiting-client
Jan 3, 2023
Merged
[JetBrains] Avoid shutting down terminals when closing the client #15527
roboquat
merged 1 commit into
main
from
felladrin/avoid-shutting-down-terminals-when-exiting-client
Jan 3, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment was marked as resolved.
This comment was marked as resolved.
felladrin
changed the title
[JetBrains] Avoid shutting down terminals when disconnecting the client
[JetBrains] Avoid shutting down terminals when closing the client
Dec 30, 2022
felladrin
force-pushed
the
felladrin/avoid-shutting-down-terminals-when-exiting-client
branch
from
December 30, 2022 15:38
a1f5fbf
to
bb392d2
Compare
This comment was marked as resolved.
This comment was marked as resolved.
felladrin
force-pushed
the
felladrin/avoid-shutting-down-terminals-when-exiting-client
branch
from
December 30, 2022 16:52
bb392d2
to
bdd2bb6
Compare
This comment was marked as resolved.
This comment was marked as resolved.
...jetbrains/backend-plugin/src/main/kotlin/io/gitpod/jetbrains/remote/GitpodTerminalService.kt
Show resolved
Hide resolved
...jetbrains/backend-plugin/src/main/kotlin/io/gitpod/jetbrains/remote/GitpodTerminalService.kt
Outdated
Show resolved
Hide resolved
Contributor
/werft run recreate-preview 👍 started the job as gitpod-build-felladrin-avoid-shutting-down-terminals-whena.5 |
andreafalzetti
approved these changes
Jan 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed and tested, works as expected ✅
/hold
Unhold when you're ready
Instead, close the widgets and reopen then when the client joins again.
felladrin
force-pushed
the
felladrin/avoid-shutting-down-terminals-when-exiting-client
branch
from
January 3, 2023 15:48
bdd2bb6
to
bfdd9c3
Compare
roboquat
deleted the
felladrin/avoid-shutting-down-terminals-when-exiting-client
branch
January 3, 2023 16:15
roboquat
added
deployed: IDE
IDE change is running in production
deployed
Change is completely running in production
labels
Jan 4, 2023
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
editor: jetbrains
release-note
size/M
team: IDE
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR changes the following:
application.executeOnPooledThread
(thread) withlifetime.launch
(coroutine).About the changes
Making the
GitpodTerminalService
class extendDisposable
opens doors for us to use thedefineNestedLifetime()
method inside the class.This method creates a LifetimeDefinition that is automatically terminated whenever the class is disposed.
GitpodTerminalService
is created when a Controller Client connects and disposed when the client disconnects.The LifetimeDefinition also allow us to launch coroutines (via
launch
method), and these coroutines are automatically terminated when the lifetime terminates.This allows us to rely on the lifetime life-cycle to avoid running something in case the Controller Client disconnects.
For example: If we do the following,
<some_task>
won't be executed if the lifetime is terminated within 5 seconds after the coroutine is launched:We currently have no way to know if a terminal widget was closed manually by the user or if it was closed due to the user closing JetBrains Client [1], so this allows us to prevent
<some_task>
[shutting down Gitpod Task Terminals, in our case] from running if JetBrains client has been closed. Gitpod Task Terminals are only shut down if the user clicks the "X" button in the terminal widget.Related Issue(s)
How to test
gp tasks list
to know if Gitpod Terminals are in the "running" state)Release Notes
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh