Skip to content

Commit

Permalink
Don't prematurely close context in app service.
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
Mike Wilson committed Jan 19, 2023
1 parent beacc1b commit 80eb678
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 80eb678

Please sign in to comment.