fix: don't use yamux for in-memory provisioner{,d} streams (#5136)

This commit is contained in:
Colin Adler
2022-11-22 12:19:32 -06:00
committed by GitHub
parent 2b6c229e4e
commit 1f20cab110
14 changed files with 105 additions and 57 deletions

View File

@ -644,7 +644,7 @@ func compressHandler(h http.Handler) http.Handler {
// CreateInMemoryProvisionerDaemon is an in-memory connection to a provisionerd. Useful when starting coderd and provisionerd
// in the same process.
func (api *API) CreateInMemoryProvisionerDaemon(ctx context.Context, debounce time.Duration) (client proto.DRPCProvisionerDaemonClient, err error) {
clientSession, serverSession := provisionersdk.TransportPipe()
clientSession, serverSession := provisionersdk.MemTransportPipe()
defer func() {
if err != nil {
_ = clientSession.Close()
@ -705,5 +705,5 @@ func (api *API) CreateInMemoryProvisionerDaemon(ctx context.Context, debounce ti
_ = serverSession.Close()
}()
return proto.NewDRPCProvisionerDaemonClient(provisionersdk.Conn(clientSession)), nil
return proto.NewDRPCProvisionerDaemonClient(clientSession), nil
}