Skip to content

Commit 4ef8d0d

Browse files
authored
Merge pull request moby#5116 from fanjiyun/fix-cache-db
bboltcachestorage: only delete link after releasing result
2 parents f18994b + e75d776 commit 4ef8d0d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

solver/bboltcachestorage/storage.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,10 @@ func (s *Store) emptyBranchWithParents(tx *bolt.Tx, id []byte) error {
278278
}
279279

280280
if isEmptyBucket(subLinks) {
281-
if err := tx.Bucket([]byte(linksBucket)).DeleteBucket(k); err != nil {
282-
return err
281+
if subResult := tx.Bucket([]byte(resultBucket)).Bucket(k); isEmptyBucket(subResult) {
282+
if err := tx.Bucket([]byte(linksBucket)).DeleteBucket(k); err != nil {
283+
return err
284+
}
283285
}
284286
}
285287
}

0 commit comments

Comments
 (0)