Skip to content

Commit d55bfab

Browse files
authored
Merge pull request containerd#9465 from ambarve/sn_cleanup
Don't block snapshot garbage collection on Remove failures
2 parents 9a7130d + ad96fde commit d55bfab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

snapshots/windows/windows.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ func (s *snapshotter) Remove(ctx context.Context, key string) error {
282282
log.G(ctx).WithError(err1).WithField("path", renamed).Error("Failed to rename after failed commit")
283283
}
284284
}
285-
return err
285+
// Return the error wrapped in ErrFailedPrecondition so that cleanup of other snapshots will
286+
// still continue.
287+
return errors.Join(errdefs.ErrFailedPrecondition, err)
286288
}
287289

288290
if err = hcsshim.DestroyLayer(s.info, renamedID); err != nil {

0 commit comments

Comments
 (0)