xds/clusterimpl: fix uint32 overflow computing EDS drop ratio (#9257)
handleClusterConfigLocked turns each EDS drop_overload into a per-million rate with `Numerator * million / Denominator` in uint32. The numerator comes from the control plane and reaches a million for a 100% drop, so with the million denominator the product overflows a uint32 once the numerator hits 4295 (a 0.43% drop), and the rate then collapses toward zero: a 50% drop computes to 0.18% and a 100% drop to 0.36%. A fraction above 100% instead lands `RequestsPerMillion` above a million, which underflows `million - RequestsPerMillion` in newDropper. Move the computation into `dropRequestsPerMillion`, which multiplies in uint64 and caps the ratio at a million. Keeping the clamp next to the arithmetic that builds DropConfig leaves the raw numerator and denominator on the parsed resource and applies drops at the configured rate. RELEASE NOTES: * xds: fix xDS EDS drop policies being applied at a much lower rate than configured due to an integer overflow
N
Naveed committed
622a41d35dcbd9df987023d292bbca18812311c7
Parent: 216640c
Committed by GitHub <noreply@github.com>
on 7/27/2026, 9:55:17 PM