feat: add logging to pgcoord subscribe/unsubscribe (#11952)

Adds logging to unsubscribing from peer and tunnel updates in pgcoordinator, since #11950 seems to be problem with these subscriptions
This commit is contained in:
Spike Curtis 2024-01-31 12:15:58 +04:00 committed by GitHub
parent 0c30dde9b5
commit 1c8b803785
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 4 deletions

View File

@ -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 {
@ -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{}{}