Skip to content

Commit da00d16

Browse files
committed
fix: don't hold the pin lock while updating pins
fixes ipfs/kubo#6885 This commit was moved from ipfs/go-ipfs-pinner@f08a8a1
1 parent 9dbbdbf commit da00d16

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pinning/pinner/pin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,11 @@ func (p *pinner) Update(ctx context.Context, from, to cid.Cid, unpin bool) error
526526
return fmt.Errorf("'from' cid was not recursively pinned already")
527527
}
528528

529+
// Temporarily unlock while we fetch the differences.
530+
p.lock.Unlock()
529531
err := dagutils.DiffEnumerate(ctx, p.dserv, from, to)
532+
p.lock.Lock()
533+
530534
if err != nil {
531535
return err
532536
}

0 commit comments

Comments
 (0)