-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[JBGateway] connection-based client side additional heartbeat #20319
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
Conversation
b37381c to
28bfd0c
Compare
| connectionLifetime.launch { | ||
| while (isActive) { | ||
| val delaySeconds = 30 + nextInt(5, 15) | ||
| if (thinClientJob?.isActive == true) { |
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.
Is this where the actual additional heartbeating is done? The way I read it seems to me like it's only once, and I'm not really sure what the underlying signal is we use to send it.
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.
We will send it when isActive is true and thinClientJob?.isActive is true:
isActivemeans the contextconnectionLifetimeis active, the there's a connection existsthinClientJob?.isActivemeans there's a IDE client shows on user's desktop
So it can be: connectionLifetime is ready, but thin client is downloading (? I don't verify it).
| repeated string envs = 1; | ||
| } | ||
|
|
||
| message SendHeartBeatRequest {} |
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.
Would it be useful to include something like a reason here for debugging purposes?
| // Example for macOS ~/Library/Application Support/JetBrains/JetBrainsGateway2024.3/plugins | ||
| // |
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.
Nit: this comment was confusing to me at first. I think if we get rid of the part after macOS here, it will make more sense (it seemed at first like you would provide the contents of some plugin file).
|
@mustard-mh code looks good, but I am still not certain what it actually does. Would you be available to sync? |
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.
Looks good to me. I have not actually tried testing if this properly postpones timeouts, but have reviewed the code and it at least does not seem to break anything 😄.
Thank you a bunch for picking this up!
(also, left one small copy comment that I think is worth tackling. It also looks like the integration tests are somehow broken?)
| row { | ||
| checkBox("Persistent connection heartbeats") | ||
| .bindSelected(state::additionalHeartbeat) | ||
| .comment("Keep workspaces running as long as the IDE connection remains active.") |
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.
nit: we don't end with a period in the checkbox above, and neither do we in the Dashboard.
| .comment("Keep workspaces running as long as the IDE connection remains active.") | |
| .comment("Keep workspaces running as long as the IDE connection remains active") |
#20319 (comment) Co-authored-by: Filip Troníček <[email protected]>
…P) (#20320) * Update Platform Version of JetBrains Gateway Plugin (EAP) to * Revert gradle properties changes * Address Filip's feedback #20319 (comment) Co-authored-by: Filip Troníček <[email protected]> --------- Co-authored-by: Huiwen <[email protected]> Co-authored-by: Filip Troníček <[email protected]>
Description
Why we implement heartbeat implement on
supervisor? Because it's hard to change token scope in JB Gateway (tech-debt) properly. Usesupervisorto implement it is the easiest way to do so: we don't care when request failed, just need users know that this feature requires a newer installationRelated Issue(s)
Fixes CLC-803
How to test
Integration tests
Integration tests of current PR should pass
Smoke test it doesn't break JB Gateway
Test heartbeat
catfood.gitpod.cloudas your Gitpod Host (in JB preferences > Tools > Gitpod > Host). You will see errors when send heartbeat assupervisoris not deployed yetDocumentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-testPublish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/previewIf enabled this will create the environment on GCE infra
Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
Valid options are
all,workspace,webapp,ide,jetbrains,vscode,ssh. If enabled,with-previewandwith-large-vmwill be enabled./hold