Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4142fb3

Browse files
committed
chore: shutdown provisioner should stop waiting on client
1 parent845407f commit4142fb3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

‎enterprise/cli/provisionerdaemons.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ func (r *RootCmd) provisionerDaemonStart() *serpent.Command {
239239
returnxerrors.Errorf("shutdown: %w",err)
240240
}
241241

242+
// Shutdown does not call close. Must call it manually.
243+
err=srv.Close()
244+
iferr!=nil {
245+
returnxerrors.Errorf("close server: %w",err)
246+
}
247+
242248
cancel()
243249
ifxerrors.Is(exitErr,context.Canceled) {
244250
returnnil

‎provisionerd/provisionerd.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ func (p *Server) client() (proto.DRPCProvisionerDaemonClient, bool) {
236236
select {
237237
case<-p.closeContext.Done():
238238
returnnil,false
239+
case<-p.shuttingDownCh:
240+
// Shutting down should return a nil client and unblock
241+
returnnil,false
239242
caseclient:=<-p.clientCh:
240243
returnclient,true
241244
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp