Skip to content

Improve Gitpod timeouts for multiple clients (revise the 5 minute editor connection timeout) #10373

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

Closed
loujaybee opened this issue May 31, 2022 · 13 comments

Comments

@loujaybee
Copy link
Member

loujaybee commented May 31, 2022

Currently, a workspace will initiate a 5 minute timer from close of any active editor. This current behaviour assumes too much that the user is operating a single client connection. Gitpod should be smart enough to recognise when a user is making multiple connections and not time out when a user swaps between SSH, VS Code or JetBrains with a workspace.

However, in scenarios where there are two editors open, this timeout should not be triggered. Ideally, we initiate the timer from the last active editor, to prevent breaking workflows where two editors are used. We should also check: https://github.com/gitpod-io/website/issues/2144 - to ensure the timeout logic is fully documented.

See internal link [1]

@loujaybee loujaybee changed the title 2 minute timeout should not initiate with 2 editors 2 minute timeout should not initiate with multiple editors May 31, 2022
@jeanp413
Copy link
Member

I didn't know about the 2 minutes timeout and I've hit this multiple times lately while testing the SSH stuff in gitpod-desktop extension, and it was really annoying 😄

@loujaybee
Copy link
Member Author

loujaybee commented Jun 8, 2022

@loujaybee
Copy link
Member Author

If this is purely a cost-saving mechanism, we could look to modify the behavior only for certain cohorts

e.g. customers on X plans, etc?

@akosyakov
Copy link
Member

akosyakov commented Jun 9, 2022

First timeout is 3 min, not 2. Second i think 3 mins to switch between editors should be more than enough, if a user does not do for 3 mins i would say we should stop. I think we should improve communication about timeouts somehow.

But maybe it is just a bug in hertbeating? What was the reason for the issue?

@iQQBot
Copy link
Contributor

iQQBot commented Jun 9, 2022

image
it's 2min, configmap from prod.

The problem is that we set the close flag on all client exits, including SSH, which means that if you accidentally disconnect from SSH, i.e. network issue, close your laptop lid, you need to reconnect within two minutes or the workspace will time out

This behavior is actually not reciprocal, in vscode browser, the close flag is only set if you explicitly close the tab, but disconnecting, or closing the laptop lid will not cause workspace to close prematurely, but this happens with SSH connection, if your network is unstable for more than 2 minutes, workspace will close, which is not friendly

@akosyakov
Copy link
Member

The problem is that we set the close flag on all client exits, including SSH, which means that if you accidentally disconnect from SSH, i.e. network issue, close your laptop lid, you need to reconnect within two minutes or the workspace will time out

Can we distinguish graceful closing of a connection? We should not timeout on network issues and so on.

@iQQBot
Copy link
Contributor

iQQBot commented Jun 9, 2022

Can we distinguish graceful closing of a connection? We should not timeout on network issues and so on.

researching

@iQQBot
Copy link
Contributor

iQQBot commented Jun 9, 2022

https://gitpod.slack.com/archives/C01KPEPNBD0/p1654682744017129?thread_ts=1654676308.765119&cid=C01KPEPNBD0

@akosyakov akosyakov changed the title 2 minute timeout should not initiate with multiple editors [ssh] 2 minute timeout should not initiate with multiple editors Jun 9, 2022
@akosyakov akosyakov changed the title [ssh] 2 minute timeout should not initiate with multiple editors 2 minute timeout should not initiate on broken ssh connection Jun 9, 2022
@jeanp413
Copy link
Member

jeanp413 commented Jun 9, 2022

I think API heartbeat should have priority over ssh heartbeat, example:

  • User has vscode web or vscode desktop connection to a workspace and external ssh connection from terminal
    • If external ssh connection closes, use last api heartbeat logic i.e. 30 min timeout if vscode web or vscode desktop connection still open otherwise set timeout to 2 min
  • If there's only external ssh connection, set timeout to 2 min

@loujaybee loujaybee changed the title 2 minute timeout should not initiate on broken ssh connection Improve Gitpod timeouts for multiple clients (revise the 2 minute editor connection timeout) Jun 14, 2022
@akosyakov
Copy link
Member

We discussed to add more logs/analytics to learn about timeouts and SSH closing conditions.

@jkaye2012
Copy link

Just want to note that this has been impacting our team as well - developers are confused as to why workspaces are closing well before the 30 minute timeout and this seems to be the likely culprit

@loujaybee loujaybee removed their assignment Jun 22, 2022
@akosyakov
Copy link
Member

We agreed to extend the close timeout to 5mins for now: https://github.com/gitpod-io/ops/pull/2967

@akosyakov akosyakov removed the status in 🚀 IDE Team Aug 8, 2022
@akosyakov akosyakov removed this from 🚀 IDE Team Aug 8, 2022
@loujaybee loujaybee changed the title Improve Gitpod timeouts for multiple clients (revise the 2 minute editor connection timeout) Improve Gitpod timeouts for multiple clients (revise the 5 minute editor connection timeout) Aug 16, 2022
@stale
Copy link

stale bot commented Nov 23, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants