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-daemon: ignore error when workspace persistent state location not exist #12018

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

jenting
Copy link
Contributor

@jenting jenting commented Aug 10, 2022

Description

The initial workspace failed at the beginning, so the workspace's persistent state location never exist.

Related Issue(s)

Fixes #11715

How to test

Not sure, but we did see some nodes path /var/gitpod/workspaces with the folders

  • <instance-id>
  • <instance-id>-daemon

but without the corresponding <instance-id>.workspace.json.

Release Notes

None

Documentation

None

Werft options:

  • /werft with-preview

…exist

Signed-off-by: JenTing Hsiao <hsiaoairplane@gmail.com>
@werft-gitpod-dev-com
Copy link

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

return xerrors.Errorf("cannot remove workspace persistent state location: %w", err)
if os.IsNotExist(err) {
log.WithError(err).Warn("workspace persistent state location not exist")
err = nil
Copy link
Contributor Author

@jenting jenting Aug 13, 2022

Choose a reason for hiding this comment

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

I'm not sure, should we keep running the following code? or directly return here?

s.stateLock.Lock()
s.state = WorkspaceDisposed
s.operatingCondition.Broadcast()
s.stateLock.Unlock()
err = s.store.runLifecycleHooks(ctx, s)
if err != nil {
return err
}
if s.PersistentVolumeClaim {
// nothing to dispose as files are on persistent volume claim
return nil
}
if !s.FullWorkspaceBackup {
err = os.RemoveAll(s.Location)
}
if err != nil {
return xerrors.Errorf("cannot remove workspace all: %w", err)
}
return nil

@jenting jenting marked this pull request as ready for review August 13, 2022 02:31
@jenting jenting requested a review from a team August 13, 2022 02:31
@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label Aug 13, 2022
Copy link
Contributor

@sagor999 sagor999 left a comment

Choose a reason for hiding this comment

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

I think this is a good fix. LGTM.

@roboquat roboquat merged commit 512e26f into main Aug 15, 2022
@roboquat roboquat deleted the jenting/11715 branch August 15, 2022 17:36
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Aug 24, 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/XS team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ws-daemon] Unexpected error during workspace dispose
3 participants