thrift_proxy: Support thrift Header payload passthrough#18296
thrift_proxy: Support thrift Header payload passthrough#18296htuch merged 2 commits intoenvoyproxy:mainfrom
Conversation
Framed was the only transport that supported payload passthrough. However the payload of Header transport is the same as Framed. Therefore its possible to also use payload passthrough with Header to Header, Framed to Header and Header to Framed. Therefore allow those extra three combinations and add integration tests. New metrics request_passthrough and response_passthrough are added to show when payload passthrough occurs. Note that previously response_success was always incremented when performing payload passthrough, and that is corrected to only occur when parsing the payload. Signed-off-by: James Fish <jfish@pinterest.com>
Signed-off-by: James Fish <jfish@pinterest.com>
|
cc @caitong93 |
|
@htuch this doesnt change an API but does increase the scope of a boolean flag, which I believe has the intention to perform the scope increase in this PR. |
|
API change is fine, @zuercher for implementation review. |
|
I would like to get a take though on whether it's likely there is a use case that today there is some traffic that is being decoded based on Header and someone configures this feature and they have some framed traffic that is pass-thru? Will we break some legitimate traffic patterns or are these super weird and unlikely? |
I think it's very unlikely that this would change behavior for any users. And the cases were it would require either incorrectly implemented thrift filters in Envoy or a bug. My reasoning: The net effect of the enabled and supported conditions is that passthrough can only happen when it is configured and protocol-level data is not modified by Envoy. That is, in cases where Envoy's parsing of the protocol-level data only serves to validate the message. If someone were using mixed header and framed transports with a common protocol, the header transport messages would now be passed through, but only if they weren't being modified in the first place. Possible changes in behavior occur if:
|
|
/lgtm API @zuercher ack, thanks for the detailed rationale. |
|
no relevant owners for "API" |
|
/lgtm api |
Unfortunately there is a similar bug that appears for the upstream metrics too, except we always record an error. I think that it makes sense to fix both the downstream/upstream reply (success v error) metrics in a separate PR before continuing this one. In a separate PR we can also move the success/error detection logic into the |
Commit Message: Support thrift Header payload passthrough
Additional Description: Framed was the only transport that supported payload passthrough. However the payload
of Header transport is the same as Framed. Therefore its possible to also use payload
passthrough with Header to Header, Framed to Header and Header to Framed. Therefore
allow those extra three combinations and add integration tests. Note that in future if Header
transforms become supported then passthroughData will need to undo any transforms.
New metrics request_passthrough and response_passthrough are added to show when payload
passthrough occurs. Note that previously response_success was always incremented when
performing payload passthrough, and that is corrected to only occur when parsing the
payload.
This will enable payload passthrough for combinations of downstream/upstream transports that did not
previously perform passthrough. If a private filter does not implement
passthroughEnabledorpassthroughDatacorrectly, has enabled payload passthrough and is using Header to Header, Framed to Header or Header to Framed
then the filter may have issues.
Risk Level: Medium
Testing: Extended existing integration tests and verified on local deployment.
Docs Changes: Updated ThriftProxy proto docs.
Release Notes: Minor behavior change.
Platform Specific Features: N/A