Combine H1 and H2 conn_pool implementations#9668
Combine H1 and H2 conn_pool implementations#9668mattklein123 merged 50 commits intoenvoyproxy:masterfrom
Conversation
This extracts shared functionality (connection timeouts, drain callbacks) into the base class. It also introduces a base class for the ActiveClient, opening up for moving shared client functionality into the base class as well. Moves the handling of the ready/busy lists up to the base class, setting us up for reusing these for HTTP/2. Signed-off-by: Snow Pettersen <snowp@squareup.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
This can be achieved by using the existing cluster config mocks. Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
Create additional connections when the limit is reached. Signed-off-by: Greg Greenway <ggreenway@apple.com>
It was used in an intermediate version of the change. Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
Signed-off-by: Greg Greenway <ggreenway@apple.com>
|
cc @snowp |
|
I have 2 big concerns with this PR:
|
|
Re 2. I have written code myself that doesn't touch the unused circuit breaker for H1/H2 only clusters, so I'm sure there are several cases where people have bumped the max connection CB for a HTTP/1.1 only cluster to permit some concurrency but left the max request CB limit at the default. I'm wondering if we should be runtime guarding the new behavior and then communicate the change of behavior with a timeline for changing the default. Thoughts @mattklein123 ? |
Signed-off-by: Greg Greenway <ggreenway@apple.com>
snowp
left a comment
There was a problem hiding this comment.
Nice, I think this approach makes sense. Might be good to add some test coverage to the new circuit breaking behavior for H1/H2
When I ran the tests against the wrong branch. Oops. The last batch of changes I pushed definitely has a bug, I'm trying to figure out the correct way to fix it. When there is a pending request, and a connection in the process of connecting, if |
As long as there are pending requests I think we have to allow them to be served, which includes waiting for connection? |
a CONNECTING client into DRAINING, which doesn't make sense. Also minor comment improvements. Signed-off-by: Greg Greenway <ggreenway@apple.com>
|
That makes sense. I hadn't realized that the two functions serve very different use cases. I think I have the desired behavior for both now. |
|
@envoyproxy/api-shepherds PTAL at this. It's not a change to the protos, just a doc change and applying an existing field in a new context. |
mattklein123
left a comment
There was a problem hiding this comment.
Thanks, awesome work. Just a few doc comments and then I think we can ship and hopefully get some bake time!
/wait
mattklein123
left a comment
There was a problem hiding this comment.
Thanks, awesome work. @alyssawilk any further comments on this?
alyssawilk
left a comment
There was a problem hiding this comment.
LGTM - I had a draft with one comment about documenting the overrides in the release notes and you beat me to it :-P
…pplied to certain HTTP version The circuit-breaker connection pool settings `MaxRequests`and `MaxPendingRequests` apply to HTTP/1.1 as well as HTTP/2 since [1] and [2]. This was actually changed in the Istio docs via [3], but these source code comments were left, potentially causing confusion. [1] envoyproxy/envoy#9215 [2] envoyproxy/envoy#9668 [3] istio/api#2428 Signed-off-by: Christian Rohmann <christian.rohmann@inovex.de>
…pplying to particular HTTP version The circuit-breaker connection pool settings `MaxRequests`and `MaxPendingRequests` apply to HTTP/1.1 as well as HTTP/2 since [1] and [2]. This was actually changed in the Istio docs via [3], but these source code comments were left, potentially causing confusion. [1] envoyproxy/envoy#9215 [2] envoyproxy/envoy#9668 [3] istio/api#2428 Signed-off-by: Christian Rohmann <christian.rohmann@inovex.de>
…pplying to particular HTTP version (#57705) The circuit-breaker connection pool settings `MaxRequests`and `MaxPendingRequests` apply to HTTP/1.1 as well as HTTP/2 since [1] and [2]. This was actually changed in the Istio docs via [3], but these source code comments were left, potentially causing confusion. [1] envoyproxy/envoy#9215 [2] envoyproxy/envoy#9668 [3] istio/api#2428 Signed-off-by: Christian Rohmann <christian.rohmann@inovex.de>
This allows the H2 connection pool to have more than 2 connections (1 active, 1 draining), which allows things like very low values of
max_requests_per_connectionto work because there can be multiple draining connections concurrently, as well as supporting multiple active connections.Risk Level: High
Testing: Unit, integration
Docs Changes: Added to .proto; updated conn pool and circuit breaker docs; added old behavior to deprecation list
Release Notes: added
Fixes #7403
Fixes #9215