Skip to content

Commit

Permalink
Don't prematurely close context in app service. (#20437)
Browse files Browse the repository at this point in the history
The app service was prematurely closing the context for the AWS signer
handler, causing `tsh aws` requests to fail with a context cancel.
  • Loading branch information
mdwn authored Jan 20, 2023
1 parent 21974e6 commit b2bc2ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/srv/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ func New(ctx context.Context, c *Config) (*Server, error) {
monitoredApps: monitoredApps{
static: c.Apps,
},
reconcileCh: make(chan struct{}),
reconcileCh: make(chan struct{}),
closeContext: closeContext,
closeFunc: closeFunc,
}

s.closeContext, s.closeFunc = context.WithCancel(ctx)

// Make copy of server's TLS configuration and update it with the specific
// functionality this server needs, like requiring client certificates.
s.tlsConfig = copyAndConfigureTLS(s.c.TLSConfig, s.getConfigForClient)
Expand Down Expand Up @@ -317,6 +317,7 @@ func New(ctx context.Context, c *Config) (*Server, error) {
// Figure out the port the proxy is running on.
s.proxyPort = s.getProxyPort()

callClose = false
return s, nil
}

Expand Down

0 comments on commit b2bc2ed

Please sign in to comment.