Skip to content
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