Skip to content

Commit d382a9b

Browse files
committed
1
1 parent da40734 commit d382a9b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/ws-daemon/pkg/controller/workspace_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ func (wsc *WorkspaceController) doWorkspaceContentBackup(ctx context.Context, sp
363363
if !ws.IsConditionTrue(workspacev1.WorkspaceConditionForceKilledTask) {
364364
err = wsc.forceKillContainerTask(ctx, ws)
365365
if err != nil {
366-
return ctrl.Result{}, fmt.Errorf("failed to force kill container task: %w", err)
366+
glog.WithFields(ws.OWI()).WithField("workspace", req.NamespacedName).Errorf("failed to force kill task: %v", err)
367367
}
368368
err = retry.RetryOnConflict(retryParams, func() error {
369369
if err := wsc.Get(ctx, req.NamespacedName, ws); err != nil {
@@ -378,6 +378,10 @@ func (wsc *WorkspaceController) doWorkspaceContentBackup(ctx context.Context, sp
378378
return ctrl.Result{Requeue: true, RequeueAfter: 2 * time.Second}, nil
379379
}
380380

381+
if time.Since(wsk8s.GetCondition(ws.Status.Conditions, string(workspacev1.WorkspaceConditionForceKilledTask)).LastTransitionTime.Time) < 2*time.Second {
382+
return ctrl.Result{Requeue: true, RequeueAfter: 2 * time.Second}, nil
383+
}
384+
381385
glog.WithFields(ws.OWI()).WithField("workspace", req.NamespacedName).Warn("workspace container is still running after 5 minutes of deletion, starting backup anyway")
382386
err = wsc.dumpWorkspaceContainerInfo(ctx, ws)
383387
if err != nil {

0 commit comments

Comments
 (0)