mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-30 07:43:42 +00:00
control/controlclient: add debug netmap refcount
Signed-off-by: Brad Fitzpatrick <brad@tailscale.com> Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
parent
a62fb13b63
commit
6a69c05c04
@ -15,6 +15,7 @@ import (
|
||||
"slices"
|
||||
"strconv"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"tailscale.com/control/controlknobs"
|
||||
@ -817,6 +818,8 @@ func (ms *mapSession) sortedPeers() []tailcfg.NodeView {
|
||||
return ret
|
||||
}
|
||||
|
||||
var numNetmaps atomic.Int64
|
||||
|
||||
// netmap returns a fully populated NetworkMap from the last state seen from
|
||||
// a call to updateStateFromResponse, filling in omitted
|
||||
// information from prior MapResponse values.
|
||||
@ -841,6 +844,10 @@ func (ms *mapSession) netmap() *netmap.NetworkMap {
|
||||
TKAEnabled: ms.lastTKAInfo != nil && !ms.lastTKAInfo.Disabled,
|
||||
MaxKeyDuration: ms.lastMaxExpiry,
|
||||
}
|
||||
ms.logf("XXX NetMap++ => %v", numNetmaps.Add(1))
|
||||
runtime.SetFinalizer(nm, func(nm *netmap.NetworkMap) {
|
||||
ms.logf("XXX NetMap-- => %v", numNetmaps.Add(-1))
|
||||
})
|
||||
|
||||
if ms.lastTKAInfo != nil && ms.lastTKAInfo.Head != "" {
|
||||
if err := nm.TKAHead.UnmarshalText([]byte(ms.lastTKAInfo.Head)); err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user