Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
envoy/rds: disable default timeout for route to clusters (#4127)
Browse files Browse the repository at this point in the history
Disabled the default 15s timeout for routes to clusters
because this results in connections being reset when the
requests take longer than 15s, such as in the case of
large file transfers.

Configurable timeouts to access services will be supported
in a future release of OSM.

Signed-off-by: Shashank Ram <[email protected]>
  • Loading branch information
shashankram authored Sep 17, 2021
1 parent e166752 commit 2bb06c0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/envoy/rds/route/route_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
xds_route "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
xds_matcher "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3"
"github.com/golang/protobuf/ptypes/duration"
"github.com/golang/protobuf/ptypes/wrappers"

"github.com/openservicemesh/osm/pkg/configurator"
Expand Down Expand Up @@ -225,6 +226,9 @@ func buildRoute(pathMatchTypeType trafficpolicy.PathMatchType, path string, meth
ClusterSpecifier: &xds_route.RouteAction_WeightedClusters{
WeightedClusters: buildWeightedCluster(weightedClusters),
},
// Disable default 15s timeout. This otherwise results in requests that take
// longer than 15s to timeout, e.g. large file transfers.
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{
RetryOn: retryPolicy.RetryOn,
NumRetries: retryPolicy.NumRetries,
Expand Down
12 changes: 12 additions & 0 deletions pkg/envoy/rds/route/route_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ func TestBuildRoute(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{},
},
},
Expand Down Expand Up @@ -572,6 +573,7 @@ func TestBuildRoute(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{},
},
},
Expand Down Expand Up @@ -621,6 +623,7 @@ func TestBuildRoute(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{
RetryOn: "apple",
},
Expand Down Expand Up @@ -673,6 +676,7 @@ func TestBuildRoute(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{
RetryOn: "banana",
PerTryTimeout: &duration.Duration{Seconds: 2},
Expand Down Expand Up @@ -1020,6 +1024,7 @@ func TestBuildEgressRoute(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{
RetryOn: "pear",
PerTryTimeout: &duration.Duration{Seconds: 2},
Expand Down Expand Up @@ -1061,6 +1066,7 @@ func TestBuildEgressRoute(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{
RetryOn: "cake",
PerTryTimeout: &duration.Duration{Seconds: 2},
Expand Down Expand Up @@ -1211,6 +1217,7 @@ func TestBuildOutboundMeshRouteConfiguration(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{},
},
},
Expand Down Expand Up @@ -1263,6 +1270,7 @@ func TestBuildOutboundMeshRouteConfiguration(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{},
},
},
Expand Down Expand Up @@ -1321,6 +1329,7 @@ func TestBuildOutboundMeshRouteConfiguration(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{},
},
},
Expand Down Expand Up @@ -1461,6 +1470,7 @@ func TestBuildEgressRouteConfiguration(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{},
},
},
Expand Down Expand Up @@ -1507,6 +1517,7 @@ func TestBuildEgressRouteConfiguration(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{},
},
},
Expand Down Expand Up @@ -1559,6 +1570,7 @@ func TestBuildEgressRouteConfiguration(t *testing.T) {
TotalWeight: &wrappers.UInt32Value{Value: 100},
},
},
Timeout: &duration.Duration{Seconds: 0},
RetryPolicy: &xds_route.RetryPolicy{},
},
},
Expand Down

0 comments on commit 2bb06c0

Please sign in to comment.