Skip to content

Commit a1c3acf

Browse files
committed
fixup! Merge branch 'main' into colin/single-pgcoord
1 parent 390e837 commit a1c3acf

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

enterprise/tailnet/pgcoord.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,6 @@ func (c *pgCoord) ServeClient(conn net.Conn, id uuid.UUID, agent uuid.UUID) erro
251251
if err := c.addSubscription(cIO, agent); err != nil {
252252
return err
253253
}
254-
defer func() {
255-
err := c.removeSubscription(cIO, agent)
256-
if err != nil {
257-
c.logger.Debug(c.ctx, "remove client subscription",
258-
slog.F("client_id", id),
259-
slog.F("agent_id", agent),
260-
slog.Error(err),
261-
)
262-
}
263-
}()
264254

265255
<-cIO.ctx.Done()
266256
return nil
@@ -924,12 +914,15 @@ func (q *querier) newClientSubscription(c agpl.Queue, agentID uuid.UUID) {
924914
q.clientSubscriptions[c.UniqueID()] = map[uuid.UUID]struct{}{}
925915
}
926916

917+
fmt.Println("add sub", c.UniqueID(), agentID)
918+
927919
mk := mKey{
928920
agent: agentID,
929921
kind: agpl.QueueKindClient,
930922
}
931923
cm, ok := q.mappers[mk]
932924
if !ok {
925+
fmt.Println("new mapper")
933926
ctx, cancel := context.WithCancel(q.ctx)
934927
mpr := newMapper(ctx, q.logger, mk, q.heartbeats)
935928
cm = &countedMapper{
@@ -952,6 +945,8 @@ func (q *querier) removeClientSubscription(c agpl.Queue, agentID uuid.UUID) {
952945
q.mu.Lock()
953946
defer q.mu.Unlock()
954947

948+
fmt.Println("remove sub", c.UniqueID(), agentID)
949+
955950
// agentID: uuid.Nil indicates that a client is going away. The querier
956951
// handles that in cleanupConn below instead.
957952
if agentID == uuid.Nil {

0 commit comments

Comments
 (0)