Repository navigation
filter state: add hashable string factory - #43208
Conversation
Change-Id: Ide0862550ebd67fc0de034daaac42be8f0fd6688 Signed-off-by: Kuat Yessenov <[email protected]>
There was a problem hiding this comment.
Nice! I remember that I followed your suggestion long back when we saw an issue with filter-state mixup in TCPProxy and had an internal patch (which I also tried upstreaming before) with almost the same implementation running internally.
It's awesome that we are adding this now as I was too scared to switch back to envoy.string after that outage and have the custom patch running all this time.
|
@agrawroh Yeah, I know it's a tricky configuration. Let me know how else I can improve it. I am worried that people are blindly copy-pasting configs from LLM without thinking about it, and this is quite subtle. |
It looks good to me. Maybe just a warning or note in the docs on the performance penalty as compared to |
Change-Id: I4f1ddd88d55001ab2eb887db32ec1d13c5a182e5 Signed-off-by: Kuat Yessenov <[email protected]>
Change-Id: Ide0862550ebd67fc0de034daaac42be8f0fd6688 Commit Message: add a hashable string that can influence HTTP connection pool when shared with upstream. Additional Description: Risk Level: low Testing: yes Docs Changes: yes Release Notes: no --------- Signed-off-by: Kuat Yessenov <[email protected]>
|
@kyessenov @agrawroh @phlax by any chance, would it be ok if I backported this to Envoy's 1.37 release branch? I fully realize that this is not a security or bug fix, but a new feature and therefore, as a matter of general policy, it wouldn't be wise to backport it to stable release branch. That being said, the reason I'm asking is that backporting this to 1.37 would help to fix a bug in an Istio release more easily. It's totally fine if we don't want to do that - I will look for other options, but wanted to check explicitly before I go for altenrative ways. |
|
@krinknmu I don't think it's right to back-port features in the mainline project. It sets a bad precedent and it makes any future (potential) fixes for the extension become complicated for all distributors. Why don't you backport in Istio OSS repo or your vendor fork? |
|
That's what I'm going to do if we can't backport it in the upstream Envoy.
…On Mon 16 Mar 2026, 16:49 Kuat, ***@***.***> wrote:
*kyessenov* left a comment (envoyproxy/envoy#43208)
<#43208 (comment)>
@krinknmu I don't think it's right to back-port features in the mainline
project. It sets a bad precedent and it makes any future (potential) fixes
for the extension become complicated for all distributors. Why don't you
backport in Istio OSS repo or your vendor fork?
—
Reply to this email directly, view it on GitHub
<#43208 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI7Q45NE34JF5XAGWT4QQT4RAWCLAVCNFSM6AAAAACTH2ADL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DANRZGEYTENJWGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This is part of the fix for istio/istio#58630 and you can find some additional context in that ticket (the other part will be to the pilot, and we'd also like to backport this change to 1.29 release branch as well). To understand why this change is needed we have to start with some background. In ambient multicluster, specifically in multi-network deployments, we rely on ambient E/W gateway to transfer data from one network to another. When communicating across network boundaries in ambient we use double-HBONE (HBONE inside another HBONE). The E/W gateway terminate the outer HBONE tunnel and transfers the inner HBONE tunnel untouched to the destination. Envoy configuration of ambient E/W gateway has two listeners important for understanding this change - `connect_terminate` and `main_internal`. `connect_terminate` listener is responsible for terminating outer HBONE tunnel, extracting and preserving all the relevant routing information (e.g. authority from HTTP CONNECT request and some headers). However, `connect_terminate` does not make any routing decisions, instead it passes all the relevant information to the internal `main_internal` listener via filter state, and then `main_internal` listener is actually responsible for routing the request correctly. To transfer data to `main_internal` listener, `connect_terminate` listener opens an "internal" connection - it's a connection implemented purely in Envoy, but it implements the same interface as any other connections that Envoy supports and for many intents and purposes is not that different from say TCP connections. One thing that is particularly important for this PR is that Envoy does connection pooling for internal connections like it does for any other connections. Connections from the same pool assumed to share the same filter state (via transport socket options) with the upstream internal listener (e.g., `main_internal` listener in our case). So if you have two HTTP2 streams with different authority in the HBONE connect requests, only authority from the stream handled first will be communicated to the upstream internal listener - that's not what we want. Envoy in principle recognizes that filter state may affect some routing decisions, so for some types of filter state objects shared with upstream Envoy can tell that it should use different connection pools to avoid mixing unrelated requests together, however `envoy.string` type we currently use to communicate authority from the HBONE CONNECT requests is not one of such types. Recently, Envoy introduced `envoy.hashable_string` that does what we need (see envoyproxy/envoy#43208), but this change didn't make it to Envoy 1.37 release branch and it will not be backported. NOTE: I checked other existing filter state object types, and they don't suit us either, so upstream Envoy `envoy.hashable_string` is basically the first and the only one that works for us. NOTE: From Envoy point of view that change is not a bug or security fix, so the fact that it should not be backported makes perfect sense, but just in case I also explicitly asked in that PR if we could backport it and got an explicit response that it's quite undesirable. So this PR introduces `istio.hashable_string` which does exactly the same thing that upstream `envoy.hashable_string` does, however we can backport it to the Istio's 1.29 release branch without relying on upstream Envoy. Eventually, we can phase it out in favor of the upstream Envoy `envoy.hashable_string`. With the current Istio release cadence, according to https://istio.io/latest/docs/releases/supported-releases/, we should be able to phase it out completely in about 2 quarters and 6 weeks. Together with the fact that the extensions is quite small, I think that it's manageable to add it to the Istio proxy repor, even if it's not ideal. Signed-off-by: Mikhail Krinkin <[email protected]>
This is part of the fix for istio/istio#58630 and you can find some additional context in that ticket (the other part will be to the pilot, and we'd also like to backport this change to 1.29 release branch as well). To understand why this change is needed we have to start with some background. In ambient multicluster, specifically in multi-network deployments, we rely on ambient E/W gateway to transfer data from one network to another. When communicating across network boundaries in ambient we use double-HBONE (HBONE inside another HBONE). The E/W gateway terminate the outer HBONE tunnel and transfers the inner HBONE tunnel untouched to the destination. Envoy configuration of ambient E/W gateway has two listeners important for understanding this change - `connect_terminate` and `main_internal`. `connect_terminate` listener is responsible for terminating outer HBONE tunnel, extracting and preserving all the relevant routing information (e.g. authority from HTTP CONNECT request and some headers). However, `connect_terminate` does not make any routing decisions, instead it passes all the relevant information to the internal `main_internal` listener via filter state, and then `main_internal` listener is actually responsible for routing the request correctly. To transfer data to `main_internal` listener, `connect_terminate` listener opens an "internal" connection - it's a connection implemented purely in Envoy, but it implements the same interface as any other connections that Envoy supports and for many intents and purposes is not that different from say TCP connections. One thing that is particularly important for this PR is that Envoy does connection pooling for internal connections like it does for any other connections. Connections from the same pool assumed to share the same filter state (via transport socket options) with the upstream internal listener (e.g., `main_internal` listener in our case). So if you have two HTTP2 streams with different authority in the HBONE connect requests, only authority from the stream handled first will be communicated to the upstream internal listener - that's not what we want. Envoy in principle recognizes that filter state may affect some routing decisions, so for some types of filter state objects shared with upstream Envoy can tell that it should use different connection pools to avoid mixing unrelated requests together, however `envoy.string` type we currently use to communicate authority from the HBONE CONNECT requests is not one of such types. Recently, Envoy introduced `envoy.hashable_string` that does what we need (see envoyproxy/envoy#43208), but this change didn't make it to Envoy 1.37 release branch and it will not be backported. NOTE: I checked other existing filter state object types, and they don't suit us either, so upstream Envoy `envoy.hashable_string` is basically the first and the only one that works for us. NOTE: From Envoy point of view that change is not a bug or security fix, so the fact that it should not be backported makes perfect sense, but just in case I also explicitly asked in that PR if we could backport it and got an explicit response that it's quite undesirable. So this PR introduces `istio.hashable_string` which does exactly the same thing that upstream `envoy.hashable_string` does, however we can backport it to the Istio's 1.29 release branch without relying on upstream Envoy. Eventually, we can phase it out in favor of the upstream Envoy `envoy.hashable_string`. With the current Istio release cadence, according to https://istio.io/latest/docs/releases/supported-releases/, we should be able to phase it out completely in about 2 quarters and 6 weeks. Together with the fact that the extensions is quite small, I think that it's manageable to add it to the Istio proxy repor, even if it's not ideal. Signed-off-by: Mikhail Krinkin <[email protected]>
This is part of the fix for istio/istio#58630 and you can find some additional context in that ticket (the other part will be to the pilot, and we'd also like to backport this change to 1.29 release branch as well). To understand why this change is needed we have to start with some background. In ambient multicluster, specifically in multi-network deployments, we rely on ambient E/W gateway to transfer data from one network to another. When communicating across network boundaries in ambient we use double-HBONE (HBONE inside another HBONE). The E/W gateway terminate the outer HBONE tunnel and transfers the inner HBONE tunnel untouched to the destination. Envoy configuration of ambient E/W gateway has two listeners important for understanding this change - `connect_terminate` and `main_internal`. `connect_terminate` listener is responsible for terminating outer HBONE tunnel, extracting and preserving all the relevant routing information (e.g. authority from HTTP CONNECT request and some headers). However, `connect_terminate` does not make any routing decisions, instead it passes all the relevant information to the internal `main_internal` listener via filter state, and then `main_internal` listener is actually responsible for routing the request correctly. To transfer data to `main_internal` listener, `connect_terminate` listener opens an "internal" connection - it's a connection implemented purely in Envoy, but it implements the same interface as any other connections that Envoy supports and for many intents and purposes is not that different from say TCP connections. One thing that is particularly important for this PR is that Envoy does connection pooling for internal connections like it does for any other connections. Connections from the same pool assumed to share the same filter state (via transport socket options) with the upstream internal listener (e.g., `main_internal` listener in our case). So if you have two HTTP2 streams with different authority in the HBONE connect requests, only authority from the stream handled first will be communicated to the upstream internal listener - that's not what we want. Envoy in principle recognizes that filter state may affect some routing decisions, so for some types of filter state objects shared with upstream Envoy can tell that it should use different connection pools to avoid mixing unrelated requests together, however `envoy.string` type we currently use to communicate authority from the HBONE CONNECT requests is not one of such types. Recently, Envoy introduced `envoy.hashable_string` that does what we need (see envoyproxy/envoy#43208), but this change didn't make it to Envoy 1.37 release branch and it will not be backported. NOTE: I checked other existing filter state object types, and they don't suit us either, so upstream Envoy `envoy.hashable_string` is basically the first and the only one that works for us. NOTE: From Envoy point of view that change is not a bug or security fix, so the fact that it should not be backported makes perfect sense, but just in case I also explicitly asked in that PR if we could backport it and got an explicit response that it's quite undesirable. So this PR introduces `istio.hashable_string` which does exactly the same thing that upstream `envoy.hashable_string` does, however we can backport it to the Istio's 1.29 release branch without relying on upstream Envoy. Eventually, we can phase it out in favor of the upstream Envoy `envoy.hashable_string`. With the current Istio release cadence, according to https://istio.io/latest/docs/releases/supported-releases/, we should be able to phase it out completely in about 2 quarters and 6 weeks. Together with the fact that the extensions is quite small, I think that it's manageable to add it to the Istio proxy repor, even if it's not ideal. Signed-off-by: Mikhail Krinkin <[email protected]>
This is part of the fix for istio/istio#58630 and you can find some additional context in that ticket (the other part will be to the pilot, and we'd also like to backport this change to 1.29 release branch as well). To understand why this change is needed we have to start with some background. In ambient multicluster, specifically in multi-network deployments, we rely on ambient E/W gateway to transfer data from one network to another. When communicating across network boundaries in ambient we use double-HBONE (HBONE inside another HBONE). The E/W gateway terminate the outer HBONE tunnel and transfers the inner HBONE tunnel untouched to the destination. Envoy configuration of ambient E/W gateway has two listeners important for understanding this change - `connect_terminate` and `main_internal`. `connect_terminate` listener is responsible for terminating outer HBONE tunnel, extracting and preserving all the relevant routing information (e.g. authority from HTTP CONNECT request and some headers). However, `connect_terminate` does not make any routing decisions, instead it passes all the relevant information to the internal `main_internal` listener via filter state, and then `main_internal` listener is actually responsible for routing the request correctly. To transfer data to `main_internal` listener, `connect_terminate` listener opens an "internal" connection - it's a connection implemented purely in Envoy, but it implements the same interface as any other connections that Envoy supports and for many intents and purposes is not that different from say TCP connections. One thing that is particularly important for this PR is that Envoy does connection pooling for internal connections like it does for any other connections. Connections from the same pool assumed to share the same filter state (via transport socket options) with the upstream internal listener (e.g., `main_internal` listener in our case). So if you have two HTTP2 streams with different authority in the HBONE connect requests, only authority from the stream handled first will be communicated to the upstream internal listener - that's not what we want. Envoy in principle recognizes that filter state may affect some routing decisions, so for some types of filter state objects shared with upstream Envoy can tell that it should use different connection pools to avoid mixing unrelated requests together, however `envoy.string` type we currently use to communicate authority from the HBONE CONNECT requests is not one of such types. Recently, Envoy introduced `envoy.hashable_string` that does what we need (see envoyproxy/envoy#43208), but this change didn't make it to Envoy 1.37 release branch and it will not be backported. NOTE: I checked other existing filter state object types, and they don't suit us either, so upstream Envoy `envoy.hashable_string` is basically the first and the only one that works for us. NOTE: From Envoy point of view that change is not a bug or security fix, so the fact that it should not be backported makes perfect sense, but just in case I also explicitly asked in that PR if we could backport it and got an explicit response that it's quite undesirable. So this PR introduces `istio.hashable_string` which does exactly the same thing that upstream `envoy.hashable_string` does, however we can backport it to the Istio's 1.29 release branch without relying on upstream Envoy. Eventually, we can phase it out in favor of the upstream Envoy `envoy.hashable_string`. With the current Istio release cadence, according to https://istio.io/latest/docs/releases/supported-releases/, we should be able to phase it out completely in about 2 quarters and 6 weeks. Together with the fact that the extensions is quite small, I think that it's manageable to add it to the Istio proxy repor, even if it's not ideal. Signed-off-by: Mikhail Krinkin <[email protected]> Co-authored-by: Mikhail Krinkin <[email protected]>
Change-Id: Ide0862550ebd67fc0de034daaac42be8f0fd6688 Commit Message: add a hashable string that can influence HTTP connection pool when shared with upstream. Additional Description: Risk Level: low Testing: yes Docs Changes: yes Release Notes: no --------- Signed-off-by: Kuat Yessenov <[email protected]> Signed-off-by: Gustavo <[email protected]>
Change-Id: Ide0862550ebd67fc0de034daaac42be8f0fd6688
Commit Message: add a hashable string that can influence HTTP connection pool when shared with upstream.
Additional Description:
Risk Level: low
Testing: yes
Docs Changes: yes
Release Notes: no