TUN-6720: Remove forcibly closing connection during reconnect signal

Previously allowing the reconnect signal forcibly close the connection
caused a race condition on which error was returned by the errgroup
in the tunnel connection. Allowing the signal to return and provide
a context cancel to the connection provides a safer shutdown of the
tunnel for this test-only scenario.
This commit is contained in:
Devin Carr
2022-08-31 12:52:44 -07:00
parent 8ec0f7746b
commit cfef0e737f
5 changed files with 22 additions and 19 deletions

View File

@@ -295,8 +295,7 @@ func (s *Supervisor) initialize(
s.config.ProtocolSelector.Current(),
false,
}
ch := signal.New(make(chan struct{}))
go s.startTunnel(ctx, i, ch)
go s.startTunnel(ctx, i, s.newConnectedTunnelSignal(i))
time.Sleep(registrationInterval)
}
return nil