Skip to content

fix: Improve coder server shutdown procedure #3246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Only close provisionerd listener when created in Serve
Otherwise it's the callers responsibility.
  • Loading branch information
mafredri committed Jul 27, 2022
commit 23c86b5130559b21ad5f0eeef67b4aabb1461fb5
9 changes: 4 additions & 5 deletions provisionersdk/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@ func Serve(ctx context.Context, server proto.DRPCProvisionerServer, options *Ser
if err != nil {
return xerrors.Errorf("create yamux: %w", err)
}
go func() {
<-ctx.Done()
_ = stdio.Close()
}()
options.Listener = stdio
}

go func() {
<-ctx.Done()
_ = options.Listener.Close()
}()

// dRPC is a drop-in replacement for gRPC with less generated code, and faster transports.
// See: https://www.storj.io/blog/introducing-drpc-our-replacement-for-grpc
mux := drpcmux.New()
Expand Down