New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent cluster/mapping configurations are used when multiple mappings pointed to the same upstream service #3112
Comments
A few ways to workaround this issue:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@guoyiang can you share what you mean by cluster tag? |
@dvaldivia doesn't recall exactly what I did back that time. But looked a bit on the docs,
|
Closing as there is an apparent workaround. If the issue persists on 2.x please reopen. |
But then... is it still mandatory to use "clustertag" with Emissary 3.x, as a workaround to this problem? Thx! |
Describe the bug
When multiple mappings are configured to use the same upstream service, all those mappings share the same envoy cluster. But each mapping can be created with different parameters. As a result, a mapping may behave different from its configuration.
For example, ambassador is proxying to an envoy which are capable to perform gRPC transcoding. The envoy reverse proxy serves both RESTful API and gRPC API. 2 mappings are created, one for rest api and the other for gRPC, with different prefix. The gRPC mapping has
grpc: true
configured. But the setting may get ignored when ambassador configuring envoy cluster behind the gRPC route, and gRPC request fails.To Reproduce
Actual behavior
gRPC request failed. Testing gRPC API using evans failed with message "server closed the stream without sending trailers".
connect_timeout
is set to 1s which is not what's set in mapping.This is because the cluster behind mapping
testgrpc
do NOT havehttp2_protocol_options
option. Envoy won't initialize HTTP 2 connection with upstream, which caused failure in proxied gRPC requests as described here. This can be observed in envoy debug log as http1 handler is used.Expected behavior
Each mapping's envoy cluster should be configured according to the configuration of the mapping it self.
testgrpc
mapping should work as expected with 5s connect timeout. Which meanshttp2_protocol_options
should be added to envoy cluster andconnect_timeout
is set to 5s.Mapping
test
should have connect timeout as 1s.Versions (please complete the following information):
Additional context
A quick look inside this code, it seems that the cluster config is cached using cluster name, and the cached cluster config is used as is without verifying if they are configured the same way. According to this code, configs from the first mapping sorted alphabetically are getting used.
The text was updated successfully, but these errors were encountered: