Repository navigation
feat(backendtrafficpolicy): wire circuitBreaker.maxConnections for UDPRoute - #10452
Conversation
…PRoute BackendTrafficPolicy.circuitBreaker was accepted on UDPRoutes and on Gateways with UDP listeners, but ir.UDPRoute had no field for it, so the cluster behind udp_proxy always got the default thresholds. Envoy's udp_proxy counts each session against the cluster's connection limit and checks no other circuit breaker threshold, so carry only maxConnections onto UDP routes and onto merged UDP clusters. Fixes envoyproxy#10417 Signed-off-by: Wali Ahed Hussain <121812531+Wali05@users.noreply.github.com>
✅ Deploy Preview for cerulean-figolla-1f9435 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10452 +/- ##
==========================================
+ Coverage 82.79% 82.87% +0.08%
==========================================
Files 278 279 +1
Lines 44521 44672 +151
==========================================
+ Hits 36859 37020 +161
+ Misses 7661 7651 -10
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Wali Ahed Hussain <121812531+Wali05@users.noreply.github.com>
|
Nit, non-blocking: could the |
For a UDPRoute, maxConnections limits concurrent sessions and the other circuit breaker thresholds are ignored. Signed-off-by: Wali Ahed Hussain <121812531+Wali05@users.noreply.github.com>
|
Thanks for the review. I've updated the Happy to point at the idle timeout setting once #10111 lands. |
What this PR does / why we need it:
BackendTrafficPolicy.circuitBreakerwas accepted for UDPRoutes, butir.UDPRoutehad no field for it, so the cluster behindudp_proxyalways got the default thresholds.How:
maxConnectionsis carried to UDP.udp_proxycounts each session against the cluster's connection limit and doesn't check any other circuit breaker threshold, somaxPendingRequests,maxParallelRequests,maxParallelRetries,maxRequestsPerConnection,perEndpointandretryBudgetare still dropped for UDP, as they are today. A newir.CircuitBreaker.UDPOnly()builds that subset, the same wayTimeout.ClusterOnly()does for TCP.ir.UDPRoutegets aCircuitBreakerfield. It is set by both the route-targeted and the Gateway/listener-targeted apply loops, andUDPRouteTranslator.asClusterArgspasses it to the cluster.mergeBackends,applyGatewayPolicyToMergedClusteradds the same subset to merged UDP clusters, so merged and unmerged clusters stay the same, as the comment on that function asks.Effect on existing UDP traffic:
maxConnectionsdefaults to 1024 in the API, which is also Envoy's default, so only policies that setmaxConnectionsto some other value change UDP behaviour.Tests:
udp-route-circuit-breaker: the UDP cluster now hasmaxConnections: 100in its thresholds.circuitBreakeron a policy covering a UDPRoute now showcircuitBreaker: {maxConnections: N}on the UDP route or merged UDP cluster. Health check and the other thresholds are still left off.UDPOnly()(nil, nomaxConnections, onlymaxConnectionskept, no aliasing).Possible follow-up, not changed here: when the policy targets a Gateway, the TCP loop in
translateBackendTrafficPolicyForListenersdoesn't setBackendConnectionon TCP routes, but the route-targeted loop does (andTCPRouteTranslatorreads it). The merged TCP cluster subset inapplyGatewayPolicyToMergedClusterleaves it out too. That may be on purpose, but it looks like the same kind of gap.Which issue(s) this PR fixes:
Fixes #10417
PR Checklist
git commit -s). See DCO: Sign your work./api.make gen-checkandmake lintpass on this branch. CI unit-test/coverage still to run on the PR. (Flaky e2e failures are not considered breakages, butgen-check,lint, and coverage MUST pass.)circuitBreakerby route type, so nothing there is wrong after this change.release-notes/current/new_features/10417-udproute-circuit-breaker-max-connections.md.zz_generated.deepcopy.goregenerated with controller-gen and committed; no API, helm or module changes.release-notes/current/breaking_changes/.