mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
ipn/{ipnlocal,localapi}, cli: add debug force-netmap-update
For loading testing & profiling the cost of full netmap updates. Updates #1909 Change-Id: I0afdf5de9967f8d95c7f81d5b531ed1c92c3208f Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
75dbd71f49
commit
04fabcd359
@@ -2133,6 +2133,23 @@ func (b *LocalBackend) DebugNotify(n ipn.Notify) {
|
||||
b.send(n)
|
||||
}
|
||||
|
||||
// DebugForceNetmapUpdate forces a full no-op netmap update of the current
|
||||
// netmap in all the various subsystems (wireguard, magicsock, LocalBackend).
|
||||
//
|
||||
// It exists for load testing reasons (for issue 1909), doing what would happen
|
||||
// if a new MapResponse came in from the control server that couldn't be handled
|
||||
// incrementally.
|
||||
func (b *LocalBackend) DebugForceNetmapUpdate() {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
nm := b.netMap
|
||||
b.e.SetNetworkMap(nm)
|
||||
if nm != nil {
|
||||
b.magicConn().SetDERPMap(nm.DERPMap)
|
||||
}
|
||||
b.setNetMapLocked(nm)
|
||||
}
|
||||
|
||||
// send delivers n to the connected frontend and any API watchers from
|
||||
// LocalBackend.WatchNotifications (via the LocalAPI).
|
||||
//
|
||||
|
Reference in New Issue
Block a user