mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: add test for coord rolling restart (#14680)
Closes https://github.com/coder/team-coconut/issues/50 --------- Co-authored-by: Ethan Dickson <ethan@coder.com>
This commit is contained in:
co-authored by
Ethan Dickson
parent
9e63caf593
commit
fbe2fa66f5
+6
-4
@@ -1485,9 +1485,6 @@ func (api *API) Close() error {
|
||||
default:
|
||||
api.cancel()
|
||||
}
|
||||
if api.derpCloseFunc != nil {
|
||||
api.derpCloseFunc()
|
||||
}
|
||||
|
||||
wsDone := make(chan struct{})
|
||||
timer := time.NewTimer(10 * time.Second)
|
||||
@@ -1513,11 +1510,16 @@ func (api *API) Close() error {
|
||||
api.updateChecker.Close()
|
||||
}
|
||||
_ = api.workspaceAppServer.Close()
|
||||
_ = api.agentProvider.Close()
|
||||
if api.derpCloseFunc != nil {
|
||||
api.derpCloseFunc()
|
||||
}
|
||||
// The coordinator should be closed after the agent provider, and the DERP
|
||||
// handler.
|
||||
coordinator := api.TailnetCoordinator.Load()
|
||||
if coordinator != nil {
|
||||
_ = (*coordinator).Close()
|
||||
}
|
||||
_ = api.agentProvider.Close()
|
||||
_ = api.statsReporter.Close()
|
||||
_ = api.NetworkTelemetryBatcher.Close()
|
||||
_ = api.OIDCConvertKeyCache.Close()
|
||||
|
||||
+2
-1
@@ -75,7 +75,8 @@ func NewServerTailnet(
|
||||
// given in this callback, it's only valid while connecting.
|
||||
if derpServer != nil {
|
||||
conn.SetDERPRegionDialer(func(_ context.Context, region *tailcfg.DERPRegion) net.Conn {
|
||||
if !region.EmbeddedRelay {
|
||||
// Don't set up the embedded relay if we're shutting down
|
||||
if !region.EmbeddedRelay || ctx.Err() != nil {
|
||||
return nil
|
||||
}
|
||||
logger.Debug(ctx, "connecting to embedded DERP via in-memory pipe")
|
||||
|
||||
Reference in New Issue
Block a user