You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/cmd
Brad Fitzpatrick 3d7fb6c21d derp/derphttp: fix race in mesh watcher
The derphttp client automatically reconnects upon failure.

RunWatchConnectionLoop called derphttp.Client.WatchConnectionChanges
once, but that wrapper method called the underlying
derp.Client.WatchConnectionChanges exactly once on derphttp.Client's
currently active connection. If there's a failure, we need to re-subscribe
upon all reconnections.

This removes the derphttp.Client.WatchConnectionChanges method, which
was basically impossible to use correctly, and changes it to be a
boolean field on derphttp.Client alongside MeshKey and IsProber. Then
it moves the call to the underlying derp.Client.WatchConnectionChanges
to derphttp's client connection code, so it's resubscribed on any
reconnect.

Some paranoia is then added to make sure people hold the API right,
not calling derphttp.Client.RunWatchConnectionLoop on an
already-started Client without having set the bool to true. (But still
auto-setting it to true if that's the first method that's been called
on that derphttp.Client, as is commonly the case, and prevents
existing code from breaking)

Fixes tailscale/corp#9916
Supercedes tailscale/tailscale#9719

Co-authored-by: Val <valerie@tailscale.com>
Co-authored-by: Irbe Krumina <irbe@tailscale.com>
Co-authored-by: Anton Tolchanov <anton@tailscale.com>
Signed-off-by: Brad Fitzpatrick <brad@danga.com>
1 year ago
..
addlicense all: update tools that manage copyright headers 2 years ago
cloner cmd/cloner: fix typo in test type's name 1 year ago
containerboot cmd/containerboot: revert to using tailscale up 1 year ago
derper derp/derphttp: fix race in mesh watcher 1 year ago
derpprobe prober: migrate to Prometheus metric library 2 years ago
dist cmd/dist,release/dist: add distsign signing hooks (#9070) 1 year ago
get-authkey all: use cmpx.Or where it made sense 1 year ago
gitops-pusher .github,cmd/gitops-pusher: update to checkout@v4 1 year ago
hello all: update copyright and license headers 2 years ago
k8s-operator cmd/k8s-operator: allow to install operator via helm (#9920) 1 year ago
mkmanifest cmd/mkmanifest, cmd/tailscale, cmd/tailscaled: remove Windows arm32 resources from OSS 2 years ago
mkpkg go.mod: upgrade nfpm to v2 (#8786) 1 year ago
mkversion version/mkversion: open-source version generation logic 2 years ago
nardump all: update copyright and license headers 2 years ago
netlogfmt go.mod: update github.com/go-json-experiment/json (#9508) 1 year ago
nginx-auth tailcfg,all: add and use Node.IsTagged() 2 years ago
pgproxy various: add golangci-lint, fix issues (#7905) 2 years ago
printdep cmd/printdep: print correct toolchain URL 2 years ago
proxy-to-grafana tailcfg,all: add and use Node.IsTagged() 2 years ago
sniproxy cmd/sniproxy: implement support for control configuration, multiple addresses 1 year ago
speedtest all: update copyright and license headers 2 years ago
ssh-auth-none-demo all: replace deprecated ioutil references 1 year ago
stunc all: update copyright and license headers 2 years ago
sync-containers all: adjust some build tags for plan9 1 year ago
tailscale ipn: add user pref for running web client 1 year ago
tailscaled ipn/ipnlocal,client/web: add web client to tailscaled 1 year ago
testcontrol all: update copyright and license headers 2 years ago
testwrapper tstest, tstest/integration, github/workflows: shard integration tests 1 year ago
tsconnect cmd/tsconnect/wasm: add missing tstun.Wrapper.Start call 1 year ago
tsshd all: update copyright and license headers 2 years ago
viewer cmd/cloner: add regression test for slice nil/empty semantics 1 year ago