Skip to content

[JetBrains] improve handling of client connection termination #20288

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

Merged
merged 4 commits into from
Oct 11, 2024
Merged

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Oct 10, 2024

Description

  • Connection provider will wait until workspace is stopped then terminate itself
    • If the stopped is due to Timed out then we will show a timed out dialog
  • If user close connection himself, we wait for 5 seconds

Related Issue(s)

Fixes ENT-804

How to test

Smoke test Gitpod Gateway Plugin

  • Use Gateway 2024.2.3 beta
  • Download matching version of Gitpod Plugin (contains branch name) in Dev channel https://plugins.jetbrains.com/plugin/18438-gitpod-gateway/versions/dev
  • Install Plugin manually with matching Gateway version
  • Quit Gateway after Plugin is installed
  • Open a workspace in any Gitpod installation (i.e. catfood) with IntelliJ IDEA as your editor
  • Click 'Open in IntelliJ IDEA' after workspace is ready
  • Set workspace timeout duration to 1 minute gp timeout set 1m
  • Wait 1 minute (more?)
  • You should see a time out dialog
  • You should not see Connection Closed by Gateway: Restart the connect via JetBrains Gateway

Documentation

Preview status

gitpod:summary

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

connectionLifetime.terminate()
GlobalScope.launch {
// Delay for 5 seconds to wait the thinClient actually close
delay(5000)
Copy link
Member

Choose a reason for hiding this comment

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

how do we know 5secs is enough, is there a triggere to which we can reliable bind instead?

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 don't think thinClient will block for 5 more seconds (unless UI freeze maybe?). From java Doc, there's no other public listeners available, I found clientProcessTerminated but it's private

image

@mustard-mh
Copy link
Contributor Author

mustard-mh commented Oct 11, 2024

@iQQBot could you please help test this PR 🙏 ? Here's the context of recent change:

  • Connection provider will wait until workspace is stopped then terminate itself
    • If the stopped is due to Timed out then we will show a timed out dialog
  • If user close connection himself, we wait for 5 seconds

You could consider the screenshot below as 'connection provider' and you could check also this Loom

image

Copy link
Contributor

@iQQBot iQQBot left a comment

Choose a reason for hiding this comment

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

image

works as expected

@roboquat roboquat merged commit 41b6404 into main Oct 11, 2024
44 checks passed
@roboquat roboquat deleted the hw/ENT-804 branch October 11, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants