-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pinning bugs & questions #6428
Comments
|
@Stebalien with respect to point 1 above: |
With respect to point 3 I found this commit with message
I believe that comment is no longer accurate, because calls to Pin() should be protected by |
You know, I think you're right. That API really is one massive footgun.
Yes. Really, that was never accurate. I was trying to fix a bug and failed. That bug has since been fixed correctly. |
All of these items are addressed in the current pinner:
|
It seems like
PinAPI
takes ablockstore.PinLock()
forAdd()
andUpdate()
but not Rm().In PinAPI.Add() we call
Pin()
, thenProvide()
, thenFlush()
. But ifProvide()
fails then we’re left in a state where a pin has been added in memory but not flushed. @michaelavila points out thatProvide()
adds a CID to a queue and it is actually provided asynchronously, so the current code probably makes sense but it might be worth adding a comment explaining this is the case.In pinner.Pin(), we
dserv.Add()
(seems like it would be more efficient to take the lock after callingdserv.Add()
)dserv.Add()
and then calldserv.Get()
(for a direct pin) ormdag.FetchGraph()
(for a recursive pin). Why do we callGet()
when we've just calledAdd()
?The text was updated successfully, but these errors were encountered: