ipn/ipnlocal: fix deadlock in resetControlClientLocked
resetControlClientLocked is called while b.mu was held and would call cc.Shutdown which would wait for the observer queue to drain. However, there may be active callbacks from cc already waiting for b.mu resulting in a deadlock. This makes it so that resetControlClientLocked does not call Shutdown, and instead just returns the value. It also makes it so that any status received from previous cc are ignored. Updates tailscale/corp#12827 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@ -104,7 +104,11 @@ type Direct struct {
|
||||
// Observer is implemented by users of the control client (such as LocalBackend)
|
||||
// to get notified of changes in the control client's status.
|
||||
type Observer interface {
|
||||
SetControlClientStatus(Status)
|
||||
// SetControlClientStatus is called when the client has a new status to
|
||||
// report. The Client is provided to allow the Observer to track which
|
||||
// Client is reporting the status, allowing it to ignore stale status
|
||||
// reports from previous Clients.
|
||||
SetControlClientStatus(Client, Status)
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
|
Reference in New Issue
Block a user