Skip to content

Commit

Permalink
Merge pull request #3614 from isala404/disable-connection-pool
Browse files Browse the repository at this point in the history
Fixed cluster creation issue with connection pooling disabled
  • Loading branch information
NomadXD authored Oct 31, 2024
2 parents 5781905 + 9f00af2 commit dff646e
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions adapter/internal/oasparser/envoyconf/routes_with_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,21 +622,7 @@ func processEndpoints(clusterName string, clusterDetails *model.EndpointCluster,
// If the endpoint is within the cluster, set the max requests per connection to 1
// This ensure cilium proxy will not reuse the connection
if withinClusterEndpoint && os.Getenv("ROUTER_DISABLE_IN_CLUSTER_CONNECTION_POOLING") == "true" {
config := &upstreams.HttpProtocolOptions{
CommonHttpProtocolOptions: &corev3.HttpProtocolOptions{
MaxRequestsPerConnection: wrapperspb.UInt32(1),
},
}

marshalledConfig, err := anypb.New(config)
if err != nil {
return nil, nil, errors.New("internal Error while marshalling the HTTP Protocol Options")
}

// Add to cluster's TypedExtensionProtocolOptions instead of deprecated fields
cluster.TypedExtensionProtocolOptions = map[string]*any.Any{
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": marshalledConfig,
}
cluster.MaxRequestsPerConnection = wrapperspb.UInt32(1)
}

if len(clusterDetails.Endpoints) > 1 {
Expand Down

0 comments on commit dff646e

Please sign in to comment.