Repository navigation
fix(server): balance every domain and location of a grouped proxy - #5609
Open
waw666waw666 wants to merge 1 commit into
Open
waw666waw666 wants to merge 1 commit into
waw666waw666 wants to merge 1 commit into
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Validation: Static review only; tests were not executed under the read-only review restrictions. Reviewed by gpt-6.1-sol · Input: 48 · Output: 6.9K · Cached: 694.4K |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY
An
httpproxy in a load balancing group can't have more than one route. With(and the same for a second proxy
bar), both proxies fail to start withgroup params invalidand nothing is routed.HTTPProxy.Runregisters the proxy once per domain/location, butHTTPGroupControllerkeeps a singleHTTPGroupper group name, which remembers the domain and location of the first registration and rejects every other route. The same happens forhttpsandtcpmuxproxies with severalcustomDomains(orcustomDomainsplussubdomain), sinceHTTPSGroupandTCPMuxGroupalso store one domain per group name. The README only asks forcustomDomains,subdomainandlocationsto be the same across the group, so this configuration is expected to work.Groups are now registered per route: the HTTP group registry is keyed by group name, domain, location and
routeByHTTPUser, HTTPS by group name and domain, and TCPMux by group name, domain androuteByHTTPUser. Each route gets its own vhost registration with all members of the group behind it, and removing a proxy removes it from every route it joined. Group key and proxy name checks are unchanged. One consequence: two proxies that use the same group name for different domains now each serve their own domain instead of the second one failing withgroup params invalid.Tests
TestHTTPGroupMultipleRoutes: two proxies with two domains and two locations each; every route balances across both proxies, a wrong group key and a repeated proxy are still rejected, unregistering removes the proxy from every route and the last one releases the routes. Fails on currentdevwithgroup params invalid.TestHTTPSAndTCPMuxGroupMultipleDomains: two proxies with two domains each forhttpsandtcpmux. Fails on currentdevwithgroup params invalid.[Feature: Group] Load Balancing HTTP with multiple domains and locations: both domains and both locations return responses from both backends. On currentdevboth proxies fail to start and the request getsno route found.go test -race ./server/... ./pkg/util/vhost/..., full e2e suite (262 passed, 2 skipped), golangci-lint with no new issues.