reverse-proxy icon indicating copy to clipboard operation
reverse-proxy copied to clipboard

ForwarderMiddleware references prior cluster

Open Tratcher opened this issue 3 years ago • 3 comments
trafficstars

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.

Tratcher avatar Jun 02 '22 15:06 Tratcher

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?

samsp-msft avatar Jun 02 '22 16:06 samsp-msft

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.

Tratcher avatar Jun 02 '22 17:06 Tratcher

Triage: We log wrong cluster (the one before reassignment).

karelz avatar Jun 07 '22 18:06 karelz