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

fix(workspace): force-stop workspaces stuck in a bad state #5055

Merged
merged 1 commit into from
Aug 6, 2021

Conversation

mrsimonemms
Copy link
Contributor

@mrsimonemms mrsimonemms commented Aug 4, 2021

fixes #5016

This was tested by scaling the ws-manager to 0 (kubectl scale deployment --replicas=0 ws-manager) and then creating a new workspace. After the elapsed time (suggest editing the ConfigMap so not waiting 2 hours) when failing to start the workspace you'll see something like this:

image

Things to note:

  • the timeouts for a workspace stuck in the state are 2 hours for unknown and preparing. This may need amending
  • the setInterval does not kill any previous runs. There are 60 seconds between runs which SHOULD be enough, but this may need adjusting
  • any errors in the setInterval are logged. Suggest adding an alert (or at least adding to Prometheus)

Future improvements:

  • improve the UX/UI so that it gives a more useful/descriptive message to the user with the fact there's been an error starting the workspace
  • improve logging so that a pattern can be found in failing workspaces

Happy to demo to anyone who wants to see it, and to check it meets the needs of the ticket

const preparingKillTime = creationTime + (this.config.timeouts.preparingPhaseSeconds * 1000);
const unknownKillTime = creationTime + (this.config.timeouts.unknownPhaseSeconds * 1000);
const exceededPreparingTime = Date.now() >= preparingKillTime;
const exceededUnknown = Date.now() >= unknownKillTime;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add Time to var

@roboquat roboquat added size/L and removed size/M labels Aug 6, 2021
@mrsimonemms mrsimonemms force-pushed the fix/5016-force-stop branch 3 times, most recently from 3cf2ecd to 2f8b04f Compare August 6, 2021 10:39
@mrsimonemms mrsimonemms marked this pull request as ready for review August 6, 2021 10:47
@csweichel
Copy link
Contributor

/lgtm

@roboquat
Copy link
Contributor

roboquat commented Aug 6, 2021

LGTM label has been added.

Git tree hash: 6959bff2c7695c390cf3398e182c7a60daf3ce9e

@roboquat
Copy link
Contributor

roboquat commented Aug 6, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: csweichel

Associated issue: #5016

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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.

Please force-stop workspace instances that are "stuck" in a bad state
3 participants