File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ func NewTunnel(
71
71
if err != nil {
72
72
return nil , err
73
73
}
74
+ uCtx , uCancel := context .WithCancel (ctx )
74
75
t := & Tunnel {
75
76
//nolint:govet // safe to copy the locks here because we haven't started the speaker
76
77
speaker : * (s ),
@@ -80,7 +81,8 @@ func NewTunnel(
80
81
requestLoopDone : make (chan struct {}),
81
82
client : client ,
82
83
updater : updater {
83
- ctx : ctx ,
84
+ ctx : uCtx ,
85
+ cancel : uCancel ,
84
86
netLoopDone : make (chan struct {}),
85
87
uSendCh : s .sendCh ,
86
88
agents : map [uuid.UUID ]tailnet.Agent {},
@@ -317,6 +319,7 @@ func sinkEntryToPb(e slog.SinkEntry) *Log {
317
319
// updates to the manager.
318
320
type updater struct {
319
321
ctx context.Context
322
+ cancel context.CancelFunc
320
323
netLoopDone chan struct {}
321
324
322
325
mu sync.Mutex
@@ -480,6 +483,7 @@ func (u *updater) stop() error {
480
483
}
481
484
err := u .conn .Close ()
482
485
u .conn = nil
486
+ u .cancel ()
483
487
return err
484
488
}
485
489
You can’t perform that action at this time.
0 commit comments