Skip to content

[management] Log BufferUpdateAccountPeers caller #4217

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

Merged
merged 1 commit into from
Jul 24, 2025

Conversation

pascal-fischer
Copy link
Collaborator

Describe your changes

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

@Copilot Copilot AI review requested due to automatic review settings July 24, 2025 16:15
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds tracing functionality to the BufferUpdateAccountPeers method to improve debugging and monitoring capabilities. The change logs the account ID and caller information whenever buffer updates are initiated for account peers.

  • Adds trace-level logging to track buffer update operations and their originating callers

@@ -1291,6 +1291,8 @@ type bufferUpdate struct {
}

func (am *DefaultAccountManager) BufferUpdateAccountPeers(ctx context.Context, accountID string) {
log.WithContext(ctx).Tracef("buffer updating peers for account %s from %s", accountID, util.GetCallerName())
Copy link
Preview

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The util.GetCallerName() function is called on every invocation of BufferUpdateAccountPeers, which typically involves stack inspection. Consider whether this performance overhead is acceptable for trace-level logging, especially if this method is called frequently.

Suggested change
log.WithContext(ctx).Tracef("buffer updating peers for account %s from %s", accountID, util.GetCallerName())
log.WithContext(ctx).Tracef("buffer updating peers for account %s from BufferUpdateAccountPeers", accountID)

Copilot uses AI. Check for mistakes.

Copy link

@pascal-fischer pascal-fischer merged commit c435c27 into main Jul 24, 2025
36 checks passed
@pascal-fischer pascal-fischer deleted the log-buffer-update-account-peers branch July 24, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants