grpc: disable gRPC connection re-use across services (#2515)

This commit is contained in:
Caleb Doxsey 2021-08-24 11:47:16 -06:00 committed by GitHub
parent 526f946097
commit f5a558d4a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 63 additions and 60 deletions

View file

@ -25,6 +25,8 @@ import (
"github.com/pomerium/pomerium/pkg/grpc/directory"
)
var outboundGRPCConnection = new(grpc.CachedOutboundGRPClientConn)
type authenticateState struct {
redirectURL *url.URL
// sharedEncoder is the encoder to use to serialize data to be consumed
@ -146,7 +148,7 @@ func newAuthenticateStateFromConfig(cfg *config.Config) (*authenticateState, err
return nil, err
}
dataBrokerConn, err := grpc.GetOutboundGRPCClientConn(context.Background(), &grpc.OutboundOptions{
dataBrokerConn, err := outboundGRPCConnection.Get(context.Background(), &grpc.OutboundOptions{
OutboundPort: cfg.OutboundPort,
InstallationID: cfg.Options.InstallationID,
ServiceName: cfg.Options.Services,