contour
contour copied to clipboard
Support setting MaxStreamDuration of both specific routes and globally
Envoy has support for setting the MaxStreamDuration both globally and on a route, I suspect configuring this instead of an envoy route timeout would resolve some SSL issues we are seeing when a downstream system has it's request interrupted halfway through a stream entry (when requesting streaming data from one of our streaming endpoints).
Contour currently has no way of passing this configuration through to Envoy.
I have had a preliminary look at the contour code and the changes required to support setting this either globally or per route seem straightforward to me:
Route Specific:
- Add
MaxStreamDuration: envoy.Timeout(r.TimeoutPolicy.MaxStreamDuration)to theRouteActioninrouteRoute() - Add
MaxStreamDuration: string `json:"maxStreamDuration,omitempty"`to theTimeoutPolicystruct - Add
MaxStreamDurationand error message totimeoutPolicy()
Global Default:
- Add
MaxStreamDuration timeout.Settingto the Timeouts struct - Add
MaxStreamDurationand an error message toParseTimeoutPolicy()function - Add
MaxStreamDuration: *string `json:"maxStreamDuration,omitempty"`to theTimeoutParametersstruct
I'm happy to open a PR to implement this.