Skip to content
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

Merged
merged 1 commit into from
Jan 13, 2025
Merged

Conversation

guggero
Copy link
Member

@guggero guggero commented Jan 13, 2025

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.

@coveralls
Copy link

coveralls commented Jan 13, 2025

Pull Request Test Coverage Report for Build 12755366307

Warning: 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

  • 0 of 18 (0.0%) changed or added relevant lines in 1 file are covered.
  • 29 unchanged lines in 8 files lost coverage.
  • Overall coverage increased (+0.01%) to 40.954%

Changes Missing Coverage Covered Lines Changed/Added Lines %
universe/auto_syncer.go 0 18 0.0%
Files with Coverage Reduction New Missed Lines %
commitment/tap.go 1 83.64%
tapgarden/planter.go 2 74.12%
tapdb/addrs.go 2 75.09%
tapchannel/aux_leaf_signer.go 3 43.43%
asset/mock.go 3 92.68%
tapgarden/caretaker.go 4 68.5%
asset/asset.go 6 80.81%
universe/interface.go 8 53.68%
Totals Coverage Status
Change from base Build 12753199015: 0.01%
Covered Lines: 26417
Relevant Lines: 64504

💛 - Coveralls

@guggero guggero requested review from ffranr and gijswijs January 13, 2025 15:14
Copy link
Contributor

@ffranr ffranr left a 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.

Copy link
Contributor

@starius starius left a 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 Show resolved Hide resolved
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)
Copy link
Contributor

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.

Copy link
Member Author

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.
@guggero
Copy link
Member Author

guggero commented Jan 13, 2025

Also, maybe it is sufficient to use Infof to make it visible? Does Warnf cause an alert?

Warnings don't trigger alarms AFAIK. At least not in our infrastructure, so I think this warrants a bit more than just info level.

@guggero guggero merged commit 6f79a36 into main Jan 13, 2025
17 of 18 checks passed
@guggero guggero deleted the sync-logging branch January 13, 2025 20:50
@dstadulis dstadulis added this to the v0.6 milestone Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[bug]: Can't create address with asset from remote universe.
5 participants