Repository navigation
gRPC/JSON transcoder: enable preserving route after headers modified - #2848
Conversation
b80ddd8 to
f55ccd5
Compare
There was a problem hiding this comment.
Call decoder_callbacks_->route() in before the header conversion if match_incoming_request_route is set, to make sure we're not depending on the behavior that HTTP conn manager pre-calculate route. Since route is cached, this call won't impact performance.
There was a problem hiding this comment.
Nit: bool JsonTranscoderConfig::matchIncomingRequestRoute() const
There was a problem hiding this comment.
This file and the .cc are out-of-sync (the newly declared field doesn't match). Can you update? Thanks?
There was a problem hiding this comment.
noticed this and hadn't had a chance to push the change. should be fixed now
f55ccd5 to
729be7f
Compare
There was a problem hiding this comment.
Nit: You can make this a const if you initialize it in the constructor initializor list.
There was a problem hiding this comment.
are you sure i can? this gets set from the proto_config passed to the constructor
|
@ilackarms this still has build failures. |
|
@htuch the build is failing because envoyproxy/data-plane-api#569 has not yet been merged. |
20d30d4 to
1f04e68
Compare
Signed-off-by: ilackarms <[email protected]>
1f04e68 to
73d7d6d
Compare
| * This allows Envoy to select the upstream cluster based on the incoming request | ||
| * rather than the outgoing. | ||
| */ | ||
| bool matchIncomingRequestRoute(); |
There was a problem hiding this comment.
Nit: bool matchIncomingRequestInfo() const;
|
sorry for the delay on this; having some trouble running bazel on my machine at the moment |
Signed-off-by: ilackarms <[email protected]>
htuch
left a comment
There was a problem hiding this comment.
LGTM modulo some nits. @ilackarms if you can do a quick cleanup PR we can merge this.
| * This allows Envoy to select the upstream cluster based on the incoming request | ||
| * rather than the outgoing. | ||
| */ | ||
| bool matchIncomingRequestRoute(); |
| public: | ||
| GrpcJsonTranscoderFilterSkipRecalculatingTest() : GrpcJsonTranscoderFilterTest(true) {} | ||
| }; | ||
|
|
There was a problem hiding this comment.
Move this down next to the relevant test.
| class GrpcJsonTranscoderFilterTest : public testing::Test { | ||
| public: | ||
| GrpcJsonTranscoderFilterTest() : config_(bookstoreProtoConfig()), filter_(config_) { | ||
| GrpcJsonTranscoderFilterTest(const bool match_incoming_request_route = false) |
There was a problem hiding this comment.
Nit: const bool doesn't really do anything here, jsut make it bool.
Signed-off-by: ilackarms <[email protected]>
Signed-off-by: ilackarms <[email protected]>
json-grpc transcoder filter: add option to skip clearing the route cache
Description:
the purpose of this PR is to add an option to the JSON-gRPC transcoder filter to allow preserving the original routing decision made by Envoy before this filter is called. Sometimes it is not desired that Envoy will not recalculate the route for a transcoded request; this option makes available that use case for the user.
This change depends on envoyproxy/data-plane-api#569 where the option to skip has been added as a parameter for the filter config
Discussion can be found here: #2847
Risk Level: Medium
Testing:
A single unit test that verifies that, when the option is enabled,
decoder_callbacks_->clearRouteCache()is not called.The change was also tested manually, where the outgoing route was matched based on the incoming
:pathheader, rather than the outgoing.Docs Changes:
Link to Data Plane PR
Release Notes:
Link to Data Plane PR (Same as above, unless I misunderstood)
[Optional Fixes #Issue]
Addresses #2847
[Optional API Changes:]
Link to Data Plane PR