Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

Commit f08a8a1

Browse files
committed
fix: don't hold the pin lock while updating pins
fixes ipfs/kubo#6885
1 parent 495dd3c commit f08a8a1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)