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

feat: Handle disconnection according to the dev workspace status #163

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

RomanNikitenko
Copy link
Contributor

@RomanNikitenko RomanNikitenko commented Jan 10, 2023

Signed-off-by: Roman Nikitenko [email protected]

What does this PR do?

Handle disconnection according to the dev workspace status:

  • Run timeout

image

  • Inactivity timeout

image

  • An error

image

  • Workspace is not running

image

Within testing I detected the following unusual use case:

  • the disconnection happened
  • the API responds that the workspace is running
  • dashboard displays the workspace as running
  • but the workspace is not usable

I've added some logic to propose reloading the window for such use case - it fixes the disconnection. See the behaviour on the video.

reload_window.mp4

What issues does this PR fix?

eclipse-che/che#21610

How to test this PR?

It's possible to change the corresponding properties to test use cases related to timeouts:

See screenshot here timeouts

Run timeout

  1. Set the workspace run timeout (checluster.spec.devEnvironments.secondsOfRunBeforeIdling) to 120, for example.
  2. Wait about 120 seconds.
  3. The corresponding dialog should be displayed.

Inactivity timeout

  1. Set the workspace inactivity timeout (checluster.spec.devEnvironments.secondsOfInactivityBeforeIdling) to 100, for example.
  2. Do not interact with the workspace 100 seconds.
  3. The corresponding dialog should be displayed.

An error

I tested the use case using minikube:

  • start a workspace using minikube
  • go to your local terminal => minikube ssh => docker ps
  • detect a container with the running VS Code and stop it, like: docker stop d9bd0222b513

docker_ps

Workspace is not running

The use case is related to the any case when

  • a workspace is not running
  • we can not detect an error, timeout or any reason of the stopped workspace

You can just stop a workspace using dashboard to test it.

@github-actions
Copy link

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

Click here to review and test in web IDE: Contribute

@RomanNikitenko RomanNikitenko marked this pull request as ready for review January 17, 2023 12:43
@RomanNikitenko RomanNikitenko changed the title Handle disconnection according to the dev workspace status feat: Handle disconnection according to the dev workspace status Jan 17, 2023
Copy link
Member

@azatsarynnyy azatsarynnyy left a comment

Choose a reason for hiding this comment

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

To test the situation when the user might receive this message
image

I've just sent a SIGKILL to the VS Code process from its terminal (kill -9 pid). In this case, DevWorkspace is still running, but VS Code is not.

Copy link
Member

@azatsarynnyy azatsarynnyy left a comment

Choose a reason for hiding this comment

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

I tested different use cases - everything works as described 👍

Thanks for updating the rebase rules.

@RomanNikitenko RomanNikitenko merged commit 61fd837 into che-incubator:main Jan 19, 2023
@RomanNikitenko RomanNikitenko deleted the handleDisconnection branch January 19, 2023 08:58
@devstudio-release
Copy link

Build 3.5 :: code_3.x/290: Console, Changes, Git Data

@devstudio-release
Copy link

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

Successfully merging this pull request may close these issues.

4 participants