-
Notifications
You must be signed in to change notification settings - Fork 124
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
universe: improve logging for single asset sync attempt #1294
Conversation
Pull Request Test Coverage Report for Build 12755366307Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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.
Nice 👍
I prefer all log params to go on the end of the message, but no big deal.
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.
LGTM! 🏆
A couple of comments.
Also, maybe it is sufficient to use Infof
to make it visible? Does Warnf
cause an alert?
universe/auto_syncer.go
Outdated
log.Warnf("Unexpected number of sync diffs %d "+ | ||
"when looking up asset %v on remote "+ | ||
"server '%v': %v", len(syncDiff), | ||
assetID.String(), addr.HostStr(), err) |
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.
Here err
is always nil
, because non-nil err would cause return
in the branching at line 857.
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.
Right, nice catch! Fixed.
When syncing a single asset (for example for creating an address) fails, the cause isn't easily visible in the logs. First, because the actual remote error wasn't logged and second because it was logged as debug. This commit fixes both.
Warnings don't trigger alarms AFAIK. At least not in our infrastructure, so I think this warrants a bit more than just info level. |
Fixes #1293.
When syncing a single asset (for example for creating an address) fails, the cause isn't easily visible in the logs. First, because the actual remote error wasn't logged and second because it was logged as debug. This commit fixes both.