summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPercy Wegmann <percy@tailscale.com>2025-03-24 15:49:58 -0500
committerPercy Wegmann <percy@tailscale.com>2025-03-25 06:44:26 -0500
commit7c61359d416eb58851fec951b7acf6129b526a52 (patch)
tree1a9e1bd27529eeb0484391a48f3b66e0f721974e
parent156cd53e7734407dc42e30af2f12cf6956cd9e24 (diff)
downloadtailscale-percy/issue14393.tar.xz
tailscale-percy/issue14393.zip
ipn/ipnlocal: add more logging for initializing peerAPIListenerspercy/issue14393
On Windows and Android, peerAPIListeners may be initialized after a link change. This commit adds log statements to make it easier to trace this flow. Updates #14393 Signed-off-by: Percy Wegmann <percy@tailscale.com>
-rw-r--r--ipn/ipnlocal/local.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go
index 0a0b2280d..1ef40d07b 100644
--- a/ipn/ipnlocal/local.go
+++ b/ipn/ipnlocal/local.go
@@ -958,7 +958,9 @@ func (b *LocalBackend) linkChange(delta *netmon.ChangeDelta) {
if peerAPIListenAsync && b.netMap != nil && b.state == ipn.Running {
want := b.netMap.GetAddresses().Len()
- if len(b.peerAPIListeners) < want {
+ have := len(b.peerAPIListeners)
+ b.logf("[v1] linkChange: have %d peerAPIListeners, want %d", have, want)
+ if have < want {
b.logf("linkChange: peerAPIListeners too low; trying again")
b.goTracker.Go(b.initPeerAPIListener)
}
@@ -5369,6 +5371,7 @@ func (b *LocalBackend) initPeerAPIListener() {
ln, err = ps.listen(a.Addr(), b.prevIfState)
if err != nil {
if peerAPIListenAsync {
+ b.logf("possibly transient peerapi listen(%q) error, will try again on linkChange: %v", a.Addr(), err)
// Expected. But we fix it later in linkChange
// ("peerAPIListeners too low").
continue