This commit is contained in:
Steven Masley 2024-05-01 21:47:29 +00:00 committed by GitHub
commit 45cbeaa6ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -239,6 +239,12 @@ func (r *RootCmd) provisionerDaemonStart() *serpent.Command {
return xerrors.Errorf("shutdown: %w", err)
}
// Shutdown does not call close. Must call it manually.
err = srv.Close()
if err != nil {
return xerrors.Errorf("close server: %w", err)
}
cancel()
if xerrors.Is(exitErr, context.Canceled) {
return nil

View File

@ -236,6 +236,9 @@ func (p *Server) client() (proto.DRPCProvisionerDaemonClient, bool) {
select {
case <-p.closeContext.Done():
return nil, false
case <-p.shuttingDownCh:
// Shutting down should return a nil client and unblock
return nil, false
case client := <-p.clientCh:
return client, true
}