listener: match rebalancer to listener IP family type#16914
listener: match rebalancer to listener IP family type#16914ggreenway merged 13 commits intoenvoyproxy:mainfrom jacob-delgado:match-ip-family-outbound-listener
Conversation
|
Hi @jacob-delgado, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
Commit Message: When getting a rebalancer by address and a wild card match is being used, the first match in the list is returned. However, if there are listeners with addresses "0.0.0.0" and "::" then the first active listener found will be used, irrespective of the IP family type. Change the behavior to always return the listener of the same IP family type as the rebalancer. Risk Level: Medium Testing: TBD Docs Changes: TBD Release Notes: inline Fixes #16804 Runtime guard: envoy.reloadable_features.listener_wildcard_match_ip_family Co-authored-by: yingchun.cai@volunteers.acasi.info Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
|
cc @lambdai Please review. I'm also looking for places to add a test, either in unit test or integration test, but could not find a suitable test to modify. Are you aware of any that I can modify or will I have to write a new one? Any guidance would be helpful. It's also unclear where I need to modify docs, if at all. |
Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
lambdai
left a comment
There was a problem hiding this comment.
LGTM!
Can you add the test? When the test env declares IPv6, it's actually ipv4+ipv6 dual stack, or ipv6 only.
You can add a test case that works for both cases and gain more eyes watching it.
Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
...to support dual stack listeners when running integration tests. When ENVOY_IP_FAMILY_TEST is set to true then listeners are not changed when usting 0.0.0.0 or :: to be of the IP type that is under test. Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
...to support dual stack listeners when running integration tests. When ENVOY_IP_FAMILY_TEST is set to true then listeners are not changed when usting 0.0.0.0 or :: to be of the IP type that is under test. Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
So after reaching out to Yuchen he pointed me to Will I also need a unit test for this to be approved? I did take a look at |
|
@lambdai can you answer the above questions? |
Sorry I may give the improper advice since I didn't know the trick here. It's probably easier to unit test it by creating a ConnectionHandlerImpl, add 1 dispatching listener(virtual) and 2 wildcard listener(ipv4 and ipv6) and accept a MockConnection at dispatching listener. The wildcard listeners doesn't require OS ipv4/ipv6 socket now so you should see fewer obstacles. Search for "ActiveTcpListenerTest, RedirectedRebalancer" for reference. That test case confirmed the balance between 2 thread of the same listener but you may want to confirm the target listener is the correct wildcard listener. Ping me if you are seeing unexpected challenges. |
Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
…delgado/envoy into match-ip-family-outbound-listener Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
| listener_callbacks1->onAccept(Network::ConnectionSocketPtr{accepted_socket}); | ||
| EXPECT_EQ(1UL, handler_->numConnections()); | ||
|
|
||
| // metrics aren't sufficient for testing; need a better way to identify the socket |
There was a problem hiding this comment.
If you like, you can create dedicate FilterChainManager for ipv6_any_listener and ipv4_any_listener
You will expect manager_ of ipv6_any_listener be called with findFilterChain
Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
|
cc @lambdai @ggreenway Yuchen had approved it, but I had to make some changes for coverage and a few other changes to make sure it's working as intended. Looking for a final review. |
I'll aim to review today. |
* main: listener: match rebalancer to listener IP family type (envoyproxy#16914) jwt_authn: implementation of www-authenticate header (envoyproxy#16216) listener: reset the file event in framework instead of listener filter doing itself (envoyproxy#17227) Small typo fix (envoyproxy#17247) Doc: Clarify request/response attributes are http-only (envoyproxy#17204) bazel/README.md: add aspell comment (envoyproxy#17072) docs: Fix broken URL links in HTTP upgrades doc (envoyproxy#17225) remove the wrong comment on test (envoyproxy#17233) upstream: allow clusters to skip waiting on warmup for initialization (envoyproxy#17179) JwtAuthn: support completing padding on forward jwt payload header (envoyproxy#16752) remove support for v2 UNSUPPORTED_REST_LEGACY (envoyproxy#16968) metrics service: fix wrong argument arrange on MetricsServiceSink (envoyproxy#17127) deps: update cel-cpp to 0.6.1 (envoyproxy#16293) Add ability to filter ConfigDump. (envoyproxy#16774) examples: fix Wasm example. (envoyproxy#17218) upstream: update host's socket factory when metadata is updated. (envoyproxy#16708) Signed-off-by: Garrett Bourg <bourg@squareup.com>
When getting a rebalancer by address and a wild card match is being used, the first match in the list is returned. However, if there are listeners with addresses "0.0.0.0" and "::" then the first active listener found will be used, irrespective of the IP family type. Change the behavior to always return the listener of the same IP family type as the rebalancer. Fixes envoyproxy#16804 Co-authored-by: yingchun.cai@volunteers.acasi.info Signed-off-by: Jacob Delgado <jacob.delgado@volunteers.acasi.info>
Commit Message:
When getting a rebalancer by address and a wild card match is being
used, the first match in the list is returned. However, if there are
listeners with addresses "0.0.0.0" and "::" then the first active
listener found will be used, irrespective of the IP family type. Change
the behavior to always return the listener of the same IP family type as
the rebalancer.
Co-authored-by: yingchun.cai@volunteers.acasi.info
Additional Description: N/A
Risk Level: Medium
Testing: TBD
Docs Changes: TBD
Release Notes: inline
Platform Specific Features: N/A
Runtime guard: envoy.reloadable_features.listener_wildcard_match_ip_family
Fixes #16804