Merge pull request #10723 from saketjajoo/3787-race-condition-fix

Fix the race condition during GC of snapshots when client retries
This commit is contained in:
Samuel Karp 2024-10-02 23:32:24 +00:00 committed by GitHub
commit e1006c0869
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -296,13 +296,6 @@ func (u *Unpacker) unpack(
} }
defer unlock() defer unlock()
if _, err := sn.Stat(ctx, chainID); err == nil {
// no need to handle
return nil
} else if !errdefs.IsNotFound(err) {
return fmt.Errorf("failed to stat snapshot %s: %w", chainID, err)
}
// inherits annotations which are provided as snapshot labels. // inherits annotations which are provided as snapshot labels.
snapshotLabels := snapshots.FilterInheritedLabels(desc.Annotations) snapshotLabels := snapshots.FilterInheritedLabels(desc.Annotations)
if snapshotLabels == nil { if snapshotLabels == nil {