-
-
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
refactor(pinmfs): log error if pre-existing pin failed #8056
Conversation
This cleans up debug logging and ensures we use %q for data read from remote services. We log pre-existing pins for MFS root and print ERROR if pin for current root has status "failed", otherwise, we log to debug.
78d64b4
to
3b4c615
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @BogdanStirbat, LGTM (tweaked messages a bit, so things look more uniform now)
@Stebalien / @aschmahmann this should be ready for final review.
FYSA this PR does not change any functionality, only adds/tweaks logs produced on ipfs log level remotepinning/mfs
on error
and debug
levels
if ps.GetPin().GetCid() == cid && ps.GetStatus() == pinclient.StatusFailed { | ||
mfslog.Errorf(pinStatusMsg, svcName, pinclient.StatusFailed, cid, existingRequestID) | ||
} else { | ||
mfslog.Debugf(pinStatusMsg, svcName, ps.GetStatus(), ps.GetPin().GetCid(), existingRequestID) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a bit awkward since if your node is offline and you start mutating MFS your log will fill up with errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, pinning is lazy atm, so service will return queued
status and then try to pin it for some time (eg. Pinata won't return failed
until N hours passed without any new bytes found).
In practice, the ERROR added in this PR is only printed once, when you restart node.
Main value here is improved logs when ipfs log level remotepinning/mfs debug
is set.
* pinmfs: log error if pin failed * refactor: log pre-existing remote mfs pins This cleans up debug logging and ensures we use %q for data read from remote services. We log pre-existing pins for MFS root and print ERROR if pin for current root has status "failed", otherwise, we log to debug. Co-authored-by: Marcin Rataj <[email protected]> (cherry picked from commit 075cc8f)
* pinmfs: log error if pin failed * refactor: log pre-existing remote mfs pins This cleans up debug logging and ensures we use %q for data read from remote services. We log pre-existing pins for MFS root and print ERROR if pin for current root has status "failed", otherwise, we log to debug. Co-authored-by: Marcin Rataj <[email protected]> (cherry picked from commit 075cc8f)
Add an error log message to
remotepinning/mfs
, in case a pin request failed.