mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 23:07:44 +00:00
control/controlclient: avert a data race when logging (#8863)
The read of the synced field for logging takes place outside the lock, and races with other (locked) writes of this field, including for example the one at current line 556 in mapRoutine. Updates tailscale/corp#13856 Change-Id: I056b36d7a93025aafdf73528dd7645f10b791af6 Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
This commit is contained in:
parent
c40d095c35
commit
9e24a6508a
@ -313,9 +313,12 @@ func (c *Auto) cancelMap() {
|
||||
// restartMap cancels the existing mapPoll and liteUpdates, and then starts a
|
||||
// new one.
|
||||
func (c *Auto) restartMap() {
|
||||
c.cancelMap()
|
||||
c.mu.Lock()
|
||||
c.cancelMapLocked()
|
||||
synced := c.synced
|
||||
c.mu.Unlock()
|
||||
|
||||
c.logf("[v1] restartMap: synced=%v", c.synced)
|
||||
c.logf("[v1] restartMap: synced=%v", synced)
|
||||
|
||||
select {
|
||||
case c.newMapCh <- struct{}{}:
|
||||
|
Loading…
x
Reference in New Issue
Block a user