summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJames Tucker <james@tailscale.com>2026-02-06 09:07:33 -0800
committerJames Tucker <jftucker@gmail.com>2026-02-06 10:20:48 -0800
commitde4a8dbcfcca4b3cdc4b437d7d2aceacfb89f0d0 (patch)
tree88cdf394dab95a029f80fbbc90000b54868dab67
parent0c5b17c1d34ce1a67d3af7fbc0e7908e8b74cf09 (diff)
downloadtailscale-de4a8dbcfcca4b3cdc4b437d7d2aceacfb89f0d0.tar.xz
tailscale-de4a8dbcfcca4b3cdc4b437d7d2aceacfb89f0d0.zip
control/controlclient: fix canSkipStatus online conditions
concurrent netmaps that if the first is logged in, it is never skipped. This should have been covered be the skip test case, but that case wasn't updated to include level set state. Updates #12639 Updates #17869 Signed-off-by: James Tucker <james@tailscale.com>
-rw-r--r--control/controlclient/auto.go15
-rw-r--r--control/controlclient/controlclient_test.go5
2 files changed, 10 insertions, 10 deletions
diff --git a/control/controlclient/auto.go b/control/controlclient/auto.go
index fe227b45e..783ca36c4 100644
--- a/control/controlclient/auto.go
+++ b/control/controlclient/auto.go
@@ -674,17 +674,16 @@ func canSkipStatus(s1, s2 *Status) bool {
// we can't skip it.
return false
}
- if s1.Err != nil || s1.URL != "" || s1.LoggedIn {
- // If s1 has an error, a URL, or LoginFinished set, we shouldn't skip it,
- // lest the error go away in s2 or in-between. We want to make sure all
- // the subsystems see it. Plus there aren't many of these, so not worth
- // skipping.
+ if s1.Err != nil || s1.URL != "" {
+ // If s1 has an error or an URL, we shouldn't skip it, lest the error go
+ // away in s2 or in-between. We want to make sure all the subsystems see
+ // it. Plus there aren't many of these, so not worth skipping.
return false
}
if !s1.Persist.Equals(s2.Persist) || s1.LoggedIn != s2.LoggedIn || s1.InMapPoll != s2.InMapPoll || s1.URL != s2.URL {
- // If s1 has a different Persist, LoginFinished, Synced, or URL than s2,
- // don't skip it. We only care about skipping the typical
- // entries where the only difference is the NetMap.
+ // If s1 has a different Persist, has changed login state, changed map
+ // poll state, or has a new login URL, don't skip it. We only care about
+ // skipping the typical entries where the only difference is the NetMap.
return false
}
// If nothing above precludes it, and both s1 and s2 have NetMaps, then
diff --git a/control/controlclient/controlclient_test.go b/control/controlclient/controlclient_test.go
index c7d61f6b2..dca1d8ddf 100644
--- a/control/controlclient/controlclient_test.go
+++ b/control/controlclient/controlclient_test.go
@@ -98,6 +98,7 @@ func TestCanSkipStatus(t *testing.T) {
nm1 := &netmap.NetworkMap{}
nm2 := &netmap.NetworkMap{}
+ commonPersist := new(persist.Persist).View()
tests := []struct {
name string
s1, s2 *Status
@@ -165,8 +166,8 @@ func TestCanSkipStatus(t *testing.T) {
},
{
name: "skip",
- s1: &Status{NetMap: nm1},
- s2: &Status{NetMap: nm2},
+ s1: &Status{NetMap: nm1, LoggedIn: true, InMapPoll: true, Persist: commonPersist},
+ s2: &Status{NetMap: nm2, LoggedIn: true, InMapPoll: true, Persist: commonPersist},
want: true,
},
}