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] Don't nil-deref on timeout computation #5013

Merged
merged 1 commit into from
Jul 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/ws-manager/pkg/manager/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,9 @@ func (m *Manager) isWorkspaceTimedOut(wso workspaceObjects) (reason string, err
return decide(*lastActivity, m.Config.Timeouts.Interrupted, activityInterrupted)

case api.WorkspacePhase_STOPPING:
if status.Conditions.FinalBackupComplete != api.WorkspaceConditionBool_TRUE {
if isPodBeingDeleted(wso.Pod) && status.Conditions.FinalBackupComplete != api.WorkspaceConditionBool_TRUE {
// Beware: we apply the ContentFinalization timeout only to workspaces which are currently being deleted.
// We basically don't expect a workspace to be in content finalization before it's been deleted.
return decide(wso.Pod.DeletionTimestamp.Time, m.Config.Timeouts.ContentFinalization, activityBackup)
} else if !isPodBeingDeleted(wso.Pod) {
// pods that have not been deleted have never timed out
Expand Down