Skip to content

Commit 610e845

Browse files
committed
fix: Run status callbacks async to solve tailnet race
1 parent 1a5d3ea commit 610e845

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tailnet/conn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func (c *Conn) SetNodeCallback(callback func(node *Node)) {
266266
c.lastDERPLatency = ni.DERPLatency
267267
node := makeNode()
268268
c.lastMutex.Unlock()
269-
callback(node)
269+
go callback(node)
270270
})
271271
c.wireguardEngine.SetStatusCallback(func(s *wgengine.Status, err error) {
272272
if err != nil {
@@ -280,7 +280,7 @@ func (c *Conn) SetNodeCallback(callback func(node *Node)) {
280280
c.lastEndpoints = endpoints
281281
node := makeNode()
282282
c.lastMutex.Unlock()
283-
callback(node)
283+
go callback(node)
284284
})
285285
}
286286

0 commit comments

Comments
 (0)