Commit 4ead108a authored by Dirk McCormick's avatar Dirk McCormick

fix: ensure pin rm takes a lock

parent ffb8bf4c
......@@ -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