-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
…exist Signed-off-by: JenTing Hsiao <hsiaoairplane@gmail.com>
started the job as gitpod-build-jenting-11715.1 because the annotations in the pull request description changed |
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 |
There was a problem hiding this comment.
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?
gitpod/components/ws-daemon/pkg/internal/session/workspace.go
Lines 210 to 232 in 5fb85e4
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 |
There was a problem hiding this 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.
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
Documentation
None
Werft options: