Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds idle_timeout envoy proxy local app config knob #14418

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/14403.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:feature
connect: Add local_idle_timeout_ms to allow configuring the Envoy idle timeout on local_app
```
6 changes: 6 additions & 0 deletions agent/xds/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ type ProxyConfig struct {
// set.
LocalConnectTimeoutMs int `mapstructure:"local_connect_timeout_ms"`

// LocalIdleTimeoutMs is the number of milliseconds a request's stream to the
// local app instance may be idle. If not set, no value is set, Envoy defaults
// are respected, and an Envoy stream_idle_timeout (5m) will apply. If set,
// this LocalIdleTimeoutMs value will override the Envoy stream_idle_timeout.
LocalIdleTimeoutMs *int `mapstructure:"local_idle_timeout_ms"`

// LocalRequestTimeoutMs is the number of milliseconds to timeout HTTP requests
// to the local app instance. If not set, no value is set, Envoy defaults are
// respected (15s)
Expand Down
7 changes: 7 additions & 0 deletions agent/xds/listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,7 @@ func (s *ResourceGenerator) makeInboundListener(cfgSnap *proxycfg.ConfigSnapshot
filterName: name,
routeName: name,
cluster: LocalAppClusterName,
idleTimeoutMs: cfg.LocalIdleTimeoutMs,
requestTimeoutMs: cfg.LocalRequestTimeoutMs,
}
if useHTTPFilter {
Expand Down Expand Up @@ -1950,6 +1951,7 @@ type listenerFilterOpts struct {
cluster string
statPrefix string
routePath string
idleTimeoutMs *int
requestTimeoutMs *int
ingressGateway bool
httpAuthzFilter *envoy_http_v3.HttpFilter
Expand Down Expand Up @@ -2074,6 +2076,11 @@ func makeHTTPFilter(opts listenerFilterOpts) (*envoy_listener_v3.Filter, error)
},
}

if opts.idleTimeoutMs != nil {
r := route.GetRoute()
r.IdleTimeout = durationpb.New(time.Duration(*opts.idleTimeoutMs) * time.Millisecond)
}

if opts.requestTimeoutMs != nil {
r := route.GetRoute()
r.Timeout = durationpb.New(time.Duration(*opts.requestTimeoutMs) * time.Millisecond)
Expand Down