diff --git a/ADOBE_CHANGELOG.md b/ADOBE_CHANGELOG.md index 66d9e369cf5..4f7dcf8c91d 100644 --- a/ADOBE_CHANGELOG.md +++ b/ADOBE_CHANGELOG.md @@ -16,6 +16,11 @@ v{C major}.{C minor}.{C fix}-{A major}.{A minor}.{A fix}-adobe # Log +## v1.1.0-2.6.0-adobe + +- invalidate IRs with idle timeouts <= 0 +- conditionally set SO_PRIORITY = 6 + ## v1.1.0-2.5.0-adobe - set SO_PRIORITY = 6 diff --git a/internal/dag/builder.go b/internal/dag/builder.go index 0c75d8d372e..6e42221a94b 100644 --- a/internal/dag/builder.go +++ b/internal/dag/builder.go @@ -986,6 +986,9 @@ func (b *Builder) processIngressRoutes(sw *ObjectStatusWriter, ir *ingressroutev if d, err := ptypes.Duration(&route.IdleTimeout.Duration); err == nil { if d > time.Hour { r.IdleTimeout = ptypes.DurationProto(time.Hour) + } else if d <= 0 { + sw.SetInvalid("route %q: idle timeout can not be disabled", route.Match) + return } else { r.IdleTimeout = &route.IdleTimeout.Duration } @@ -993,7 +996,14 @@ func (b *Builder) processIngressRoutes(sw *ObjectStatusWriter, ir *ingressroutev } if route.Timeout != nil { - r.Timeout = &route.Timeout.Duration + if d, err := ptypes.Duration(&route.Timeout.Duration); err == nil { + if d < 0 { + sw.SetInvalid("route %q: timeout value must be >= 0", route.Match) + return + } else { + r.Timeout = &route.Timeout.Duration + } + } } for _, service := range route.Services { @@ -1032,6 +1042,9 @@ func (b *Builder) processIngressRoutes(sw *ObjectStatusWriter, ir *ingressroutev if d, err := ptypes.Duration(&service.IdleTimeout.Duration); err == nil { if d > time.Hour { c.IdleTimeout = ptypes.DurationProto(time.Hour) + } else if d <= 0 { + sw.SetInvalid("route: %q service %q: idle timeout can not be disabled", route.Match, service.Name) + return } else { c.IdleTimeout = &service.IdleTimeout.Duration } diff --git a/internal/envoy/listener_adobe.go b/internal/envoy/listener_adobe.go index 07e503c9d51..64aca593ad1 100644 --- a/internal/envoy/listener_adobe.go +++ b/internal/envoy/listener_adobe.go @@ -63,12 +63,14 @@ func socketOptions() (opts []*envoy_api_v2_core.SocketOption) { opts = make([]*envoy_api_v2_core.SocketOption, 0) - opts = append(opts, &envoy_api_v2_core.SocketOption{ - Level: SOL_SOCKET, - Name: SO_PRIORITY, - Value: &envoy_api_v2_core.SocketOption_IntValue{6}, - State: envoy_api_v2_core.SocketOption_STATE_PREBIND, - }) + if enabled, err := strconv.ParseBool(os.Getenv("SO_PRIORITY")); enabled && err == nil { + opts = append(opts, &envoy_api_v2_core.SocketOption{ + Level: SOL_SOCKET, + Name: SO_PRIORITY, + Value: &envoy_api_v2_core.SocketOption_IntValue{6}, + State: envoy_api_v2_core.SocketOption_STATE_PREBIND, + }) + } if enabled, err := strconv.ParseBool(os.Getenv("TCP_KEEPALIVE_ENABLED")); enabled && err == nil { @@ -106,5 +108,10 @@ func socketOptions() (opts []*envoy_api_v2_core.SocketOption) { }) } } + + if len(opts) == 0 { + opts = nil + } + return }