From a32b5c088ff58cb293932f7696a4c3963c8e1c4d Mon Sep 17 00:00:00 2001 From: Christian Weichel Date: Thu, 29 Jul 2021 15:24:21 +0000 Subject: [PATCH] [ws-manager] Don't nil-deref on timeout computation --- components/ws-manager/pkg/manager/status.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/ws-manager/pkg/manager/status.go b/components/ws-manager/pkg/manager/status.go index f309ea03b92fdb..8d929cbdba96d3 100644 --- a/components/ws-manager/pkg/manager/status.go +++ b/components/ws-manager/pkg/manager/status.go @@ -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