-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Route key is not unique when using Host header for service discovery #1496
Comments
It's not a feature request, it's a problem with service discovery caching. The wrong route is reused from cache. A false cache hit, basically, because the route key does not include the service name. |
@sliekens 🆗 Got it now! I guess we need this key construction template: Also, UpstreamHost could be a last suffix in caching key... What do you think? |
Yep, that looks correct to me. |
The old key format did not contain enough information to disambiguate routes based on an UpstreamHost. This was especially problematic when a ServiceName was used in conjuction with Service Discovery, instead of DownstreamHostAndPorts configuration. Resolves ThreeMammals#1496
@raman-m I created a PR, the final pattern is a bit different, but it shouldn't matter. The route key is treated as an opaque string once it's created. |
The old key format did not contain enough information to disambiguate routes based on an UpstreamHost. This was especially problematic when a ServiceName was used in conjuction with Service Discovery, instead of DownstreamHostAndPorts configuration. Resolves ThreeMammals#1496
The old key format did not contain enough information to disambiguate routes based on an UpstreamHost. This was especially problematic when a ServiceName was used in conjuction with Service Discovery, instead of DownstreamHostAndPorts configuration. Resolves ThreeMammals#1496
Expected Behavior
The
RouteKey
format should include a route'sServiceName
when you use service discovery:"UpstreamPathTemplate|UpstreamHttpMethod|ServiceName"
.Actual Behavior
The default format is
"UpstreamPathTemplate|UpstreamHttpMethod|DownstreamHostAndPorts"
. The last section resolves to an empty string when you use service discovery:"/some-path|GET|"
.This leads to conflicts when multiple routes have the same upstream method and path template, but are discriminated by an
UpstreamHost
.Steps to Reproduce the Problem
UpstreamPathTemplate
andUpstreamHttpMethod
UpstreamHost
DownstreamHostAndPorts
, instead configure aServiceName
and aServiceDiscoveryProvider
.Now when you send two requests, once for each route:
The first request initiates service discovery, which resolves the host and port for
BackofficeGermany
. The resolved configuration is stored in theILoadBalancerHouse
with the key"/some-path|GET|"
.The second request has the same route key so the
ILoadBalancerHouse
entirely skips the service discovery step. Instead it reuses the configuration forBackofficeGermany
, which is wrong.Specifications
The text was updated successfully, but these errors were encountered: