Add listener_max_connection_lifetime_ms, similar to how listener_idle_timeout_ms is implemented. This limit the maximum age of a downstream connections by adding max_connection_duration to the listener's common_http_protocol_options.
This option could already be set on the clusters (upstream connections), but setting it on the downstream connections could be useful in multiple scenarios:
to periodically rebalance the load between multiple emissary-ingress, especially when most of the clients are using HTTP2/gRPC and connection stick for a really long time.
when using mTLS (client certificate), to ensure that clients reconnect with their renewed certificate, as Envoy doesn't close the connection when the certificate expires.
Related Issues
Fix #2900
Testing
Added automated tests
Not yet deployed in a real cluster
Checklist
[x] Does my change need to be backported to a previous release?
No, this is a new feature.
[ ] I made sure to update CHANGELOG.md.
Remember, the CHANGELOG needs to mention:
Any new features
Any changes to our included version of Envoy
Any non-backward-compatible changes
Any deprecations
[x] This is unlikely to impact how Ambassador performs at scale.
Remember, things that might have an impact at scale include:
Any significant changes in memory use that might require adjusting the memory limits
Any significant changes in CPU use that might require adjusting the CPU limits
Anything that might change how many replicas users should use
Changes that impact data-plane latency/scalability
[x] My change is adequately tested.
Remember when considering testing:
Your change needs to be specifically covered by tests.
Tests need to cover all the states where your change is relevant: for example, if you add a behavior that can be enabled or disabled, you'll need tests that cover the enabled case and tests that cover the disabled case. It's not sufficient just to test with the behavior enabled.
You also need to make sure that the entire area being changed has adequate test coverage.
If existing tests don't actually cover the entire area being changed, add tests.
This applies even for aspects of the area that you're not changing – check the test coverage, and improve it if needed!
We should lean on the bulk of code being covered by unit tests, but...
... an end-to-end test should cover the integration points
[ ] I updated DEVELOPING.md with any any special dev tricks I had to use to work on this code efficiently.
[x] The changes in this PR have been reviewed for security concerns and adherence to security best practices.
Description
Add listener_max_connection_lifetime_ms, similar to how listener_idle_timeout_ms is implemented. This limit the maximum age of a downstream connections by adding max_connection_duration to the listener's common_http_protocol_options.
This option could already be set on the clusters (upstream connections), but setting it on the downstream connections could be useful in multiple scenarios:
to periodically rebalance the load between multiple emissary-ingress, especially when most of the clients are using HTTP2/gRPC and connection stick for a really long time.
when using mTLS (client certificate), to ensure that clients reconnect with their renewed certificate, as Envoy doesn't close the connection when the certificate expires.
Related Issues
Fix #2900
Testing
Checklist
[x] Does my change need to be backported to a previous release?
[ ] I made sure to update
CHANGELOG.md
.Remember, the CHANGELOG needs to mention:
[x] This is unlikely to impact how Ambassador performs at scale.
Remember, things that might have an impact at scale include:
[x] My change is adequately tested.
Remember when considering testing:
[ ] I updated
DEVELOPING.md
with any any special dev tricks I had to use to work on this code efficiently.[x] The changes in this PR have been reviewed for security concerns and adherence to security best practices.