Unverified Commit 3cc35388 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #6444 from dirkmc/fix/pin-rm-add-lock

Fix: ensure pin rm takes a lock
parents ffb8bf4c 4ead108a
......@@ -67,6 +67,10 @@ func (api *PinAPI) Rm(ctx context.Context, p path.Path, opts ...caopts.PinRmOpti
return err
}
// Note: after unpin the pin sets are flushed to the blockstore, so we need
// to take a lock to prevent a concurrent garbage collection
defer api.blockstore.PinLock().Unlock()
if err = api.pinning.Unpin(ctx, rp.Cid(), settings.Recursive); err != nil {
return err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment