diff options
| author | Brad Fitzpatrick <bradfitz@tailscale.com> | 2025-12-02 12:50:33 -0800 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@tailscale.com> | 2025-12-02 15:12:13 -0800 |
| commit | 381de776c4878dd9af76b126cfa37bc80cad363f (patch) | |
| tree | c3ddcbf9613db3074c9c6882bb757357cf5bdd0a /net/dns | |
| parent | b8c58ca7c1a49fb772d095c65693cdab06488047 (diff) | |
| download | tailscale-bradfitz/mutex_debug.tar.xz tailscale-bradfitz/mutex_debug.zip | |
syncs: start working on mutex debugging, registrationbradfitz/mutex_debug
Updates #17852
Change-Id: Ib1b634eedd30cc4006bc1b39aa8d479d37c5f1f2
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'net/dns')
| -rw-r--r-- | net/dns/manager.go | 6 | ||||
| -rw-r--r-- | net/dns/resolver/forwarder.go | 1 | ||||
| -rw-r--r-- | net/dns/resolver/tsdns.go | 1 |
3 files changed, 5 insertions, 3 deletions
diff --git a/net/dns/manager.go b/net/dns/manager.go index de99fe646..5170d0b78 100644 --- a/net/dns/manager.go +++ b/net/dns/manager.go @@ -15,7 +15,6 @@ import ( "runtime" "slices" "strings" - "sync" "sync/atomic" "time" @@ -65,8 +64,8 @@ type Manager struct { knobs *controlknobs.Knobs // or nil goos string // if empty, gets set to runtime.GOOS - mu sync.Mutex // guards following - config *Config // Tracks the last viable DNS configuration set by Set. nil on failures other than compilation failures or if set has never been called. + mu syncs.Mutex // guards following + config *Config // Tracks the last viable DNS configuration set by Set. nil on failures other than compilation failures or if set has never been called. } // NewManagers created a new manager from the given config. @@ -95,6 +94,7 @@ func NewManager(logf logger.Logf, oscfg OSConfigurator, health *health.Tracker, knobs: knobs, goos: goos, } + syncs.RegisterMutex(&m.mu, "dns.Manager.mu") m.ctx, m.ctxCancel = context.WithCancel(context.Background()) m.logf("using %T", m.os) diff --git a/net/dns/resolver/forwarder.go b/net/dns/resolver/forwarder.go index 5adc43efc..83b28fdb4 100644 --- a/net/dns/resolver/forwarder.go +++ b/net/dns/resolver/forwarder.go @@ -267,6 +267,7 @@ func newForwarder(logf logger.Logf, netMon *netmon.Monitor, linkSel ForwardLinkS controlKnobs: knobs, verboseFwd: verboseDNSForward(), } + syncs.RegisterMutex(&f.mu, "resolver.forwarder.mu") f.ctx, f.ctxCancel = context.WithCancel(context.Background()) return f } diff --git a/net/dns/resolver/tsdns.go b/net/dns/resolver/tsdns.go index 3185cbe2b..25916c6c9 100644 --- a/net/dns/resolver/tsdns.go +++ b/net/dns/resolver/tsdns.go @@ -249,6 +249,7 @@ func New(logf logger.Logf, linkSel ForwardLinkSelector, dialer *tsdial.Dialer, h dialer: dialer, health: health, } + syncs.RegisterMutex(&r.mu, "resolver.Resolver.mu") r.forwarder = newForwarder(r.logf, netMon, linkSel, dialer, health, knobs) return r } |
