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

[ws-manager] improve finalizeWorkspaceContent logic #12450

Merged
merged 1 commit into from
Aug 30, 2022
Merged

Conversation

sagor999
Copy link
Contributor

@sagor999 sagor999 commented Aug 27, 2022

Description

This PR does two things:

  1. Make sure that we wait for workspace content init to finish before we attempt to dispose it. That way we will not dispose workspace, while another thread is still working on content init of it.
  2. Make sure only one finalizeWorkspaceContent is running for a given workspace. This fixes various race conditions, where finalizeWorkspaceContent may get called multiple times (one after another), and each call will attempt to dispose workspace, causing second and any after call to fail, since workspace was already disposed.

Related Issue(s)

Fixes #11710

How to test

Start and stop workspaces.
Start workspaces that fail during init, and ensure this is handled correctly.

Release Notes

none

Documentation

Werft options:

  • /werft with-preview

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-pavel-11710.1 because the annotations in the pull request description changed
(with .werft/ from main)

@sagor999
Copy link
Contributor Author

sagor999 commented Aug 29, 2022

/werft run

👍 started the job as gitpod-build-pavel-11710.2
(with .werft/ from main)

@sagor999 sagor999 marked this pull request as ready for review August 29, 2022 18:15
@sagor999 sagor999 requested a review from a team August 29, 2022 18:15
@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label Aug 29, 2022
@roboquat roboquat merged commit 92f2f1a into main Aug 30, 2022
@roboquat roboquat deleted the pavel/11710 branch August 30, 2022 06:18
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note-none size/L team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ws-daemon] Unexpected cannot find workspace during DisposeWorkspace
3 participants