Skip to content

feat: add logging to pgcoord subscribe/unsubscribe #11952

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
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions enterprise/tailnet/pgcoord.go
Original file line number Diff line number Diff line change
Expand Up @@ -992,9 +992,12 @@ func (q *querier) subscribe() {
}
return
}
defer cancelPeer()
defer func() {
q.logger.Info(q.ctx, "canceling peer updates subscription")
cancelPeer()
}()
bkoff.Reset()
q.logger.Debug(q.ctx, "subscribed to peer updates")
q.logger.Info(q.ctx, "subscribed to peer updates")

var cancelTunnel context.CancelFunc
err = backoff.Retry(func() error {
Expand All @@ -1012,8 +1015,11 @@ func (q *querier) subscribe() {
}
return
}
defer cancelTunnel()
q.logger.Debug(q.ctx, "subscribed to tunnel updates")
defer func() {
q.logger.Info(q.ctx, "canceling tunnel updates subscription")
cancelTunnel()
}()
q.logger.Info(q.ctx, "subscribed to tunnel updates")

// unblock the outer function from returning
subscribed <- struct{}{}
Expand Down