Skip to content

Commit 1c8b803

Browse files
authored
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
1 parent 0c30dde commit 1c8b803

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

enterprise/tailnet/pgcoord.go

+10-4
Original file line numberDiff line numberDiff line change
@@ -992,9 +992,12 @@ func (q *querier) subscribe() {
992992
}
993993
return
994994
}
995-
defer cancelPeer()
995+
defer func() {
996+
q.logger.Info(q.ctx, "canceling peer updates subscription")
997+
cancelPeer()
998+
}()
996999
bkoff.Reset()
997-
q.logger.Debug(q.ctx, "subscribed to peer updates")
1000+
q.logger.Info(q.ctx, "subscribed to peer updates")
9981001

9991002
var cancelTunnel context.CancelFunc
10001003
err = backoff.Retry(func() error {
@@ -1012,8 +1015,11 @@ func (q *querier) subscribe() {
10121015
}
10131016
return
10141017
}
1015-
defer cancelTunnel()
1016-
q.logger.Debug(q.ctx, "subscribed to tunnel updates")
1018+
defer func() {
1019+
q.logger.Info(q.ctx, "canceling tunnel updates subscription")
1020+
cancelTunnel()
1021+
}()
1022+
q.logger.Info(q.ctx, "subscribed to tunnel updates")
10171023

10181024
// unblock the outer function from returning
10191025
subscribed <- struct{}{}

0 commit comments

Comments
 (0)