File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -556,7 +556,6 @@ func (c *Conn) Closed() <-chan struct{} {
556
556
func (c * Conn ) Close () error {
557
557
c .logger .Info (context .Background (), "closing tailnet Conn" )
558
558
c .watchCancel ()
559
- c .telemetryWg .Wait ()
560
559
c .configMaps .close ()
561
560
c .nodeUpdater .close ()
562
561
c .mutex .Lock ()
@@ -567,6 +566,7 @@ func (c *Conn) Close() error {
567
566
default :
568
567
}
569
568
close (c .closed )
569
+ c .telemetryWg .Wait ()
570
570
c .mutex .Unlock ()
571
571
572
572
var wg sync.WaitGroup
@@ -783,6 +783,13 @@ func (c *Conn) newTelemetryEvent() *proto.TelemetryEvent {
783
783
}
784
784
785
785
func (c * Conn ) sendTelemetryBackground (e * proto.TelemetryEvent ) {
786
+ c .mutex .Lock ()
787
+ defer c .mutex .Unlock ()
788
+ select {
789
+ case <- c .closed :
790
+ return
791
+ default :
792
+ }
786
793
c .telemetryWg .Add (1 )
787
794
go func () {
788
795
defer c .telemetryWg .Done ()
You can’t perform that action at this time.
0 commit comments