Skip to content

Commit 44c9bd5

Browse files
committed
chore: nodeUpdater logging
1 parent bad2ce5 commit 44c9bd5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tailnet/configmaps.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ func (c *configMaps) configLoop() {
137137
c.Wait()
138138
}
139139
if c.closing {
140+
c.logger.Debug(context.Background(), "closing configMaps configLoop")
140141
return
141142
}
142143
// queue up the reconfiguration actions we will take while we have
@@ -146,19 +147,22 @@ func (c *configMaps) configLoop() {
146147
if c.derpMapDirty {
147148
derpMap := c.derpMapLocked()
148149
actions = append(actions, func() {
150+
c.logger.Debug(context.Background(), "updating engine DERP map", slog.F("derp_map", derpMap))
149151
c.engine.SetDERPMap(derpMap)
150152
})
151153
}
152154
if c.netmapDirty {
153155
nm := c.netMapLocked()
154156
actions = append(actions, func() {
157+
c.logger.Debug(context.Background(), "updating engine network map", slog.F("network_map", nm))
155158
c.engine.SetNetworkMap(nm)
156159
c.reconfig(nm)
157160
})
158161
}
159162
if c.filterDirty {
160163
f := c.filterLocked()
161164
actions = append(actions, func() {
165+
c.logger.Debug(context.Background(), "updating engine filter", slog.F("filter", f))
162166
c.engine.SetFilter(f)
163167
})
164168
}

tailnet/node.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ func (u *nodeUpdater) updateLoop() {
5252
u.Wait()
5353
}
5454
if u.closing {
55+
u.logger.Debug(context.Background(), "closing nodeUpdater updateLoop")
5556
return
5657
}
5758
node := u.nodeLocked()
@@ -68,6 +69,7 @@ func (u *nodeUpdater) updateLoop() {
6869
}
6970

7071
u.L.Unlock()
72+
u.logger.Debug(context.Background(), "calling nodeUpdater callback", slog.F("node", node))
7173
u.callback(node)
7274
u.L.Lock()
7375
}
@@ -126,6 +128,8 @@ func (u *nodeUpdater) setNetInfo(ni *tailcfg.NetInfo) {
126128
if u.preferredDERP != ni.PreferredDERP {
127129
dirty = true
128130
u.preferredDERP = ni.PreferredDERP
131+
u.logger.Debug(context.Background(), "new preferred DERP",
132+
slog.F("preferred_derp", u.preferredDERP))
129133
}
130134
if !maps.Equal(u.derpLatency, ni.DERPLatency) {
131135
dirty = true

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy