Open Tratcher opened 2 years ago
When you call context.ReassignProxyRequest(cluster); doesn't that set the cluster on the proxyfeature - or is this a case of the snapshot vs live config objects problem?
ReassignProxyRequest does set the cluster on the proxy feature, but the ForwarderMiddleware has some references to the original cluster via the route. The fields it's referencing are on the ClusterState, no the ClusterModel.
Triage: We log wrong cluster (the one before reassignment).
When using the reassign proxy requests as described in https://microsoft.github.io/reverse-proxy/articles/ab-testing.html, the ForwarderMiddleware continues to reference the original cluster via the Route.
https://github.com/microsoft/reverse-proxy/blob/a2165f4d9c53595d9e080c056f04e7e83761fbf0/src/ReverseProxy/Forwarder/ForwarderMiddleware.cs#L41
This affects logs and counters: https://github.com/microsoft/reverse-proxy/blob/a2165f4d9c53595d9e080c056f04e7e83761fbf0/src/ReverseProxy/Forwarder/ForwarderMiddleware.cs#L45 https://github.com/microsoft/reverse-proxy/blob/a2165f4d9c53595d9e080c056f04e7e83761fbf0/src/ReverseProxy/Forwarder/ForwarderMiddleware.cs#L69
There shouldn't be any functional impact.
This might be hard to fix because the cluster object referenced from the route is the only one with these fields.