Skip to content

Commit

Permalink
[ws-manager] Don't nil-deref on timeout computation
Browse files Browse the repository at this point in the history
  • Loading branch information
csweichel authored and roboquat committed Jul 29, 2021
1 parent 4c70e7a commit a32b5c0
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit a32b5c0

Please sign in to comment.