Similarityoung opened a new pull request, #1072: URL: https://github.com/apache/dubbo-go-pixiu/pull/1072
**What this PR does**: Path and prefix routes currently lose their header conditions when routing snapshots are built. For example, a `/user` prefix requiring both `X-A` and `X-B` can select its backend when `X-B` is absent or even when the request has no headers. Preserve compiled headers and configuration-ordered candidates in each path node. Match the full request conditions, continue to other candidates and valid paths after a rejection, and retain the existing trie traversal order, header-only priority, and specific-method-before-wildcard behavior. Keep the public RouterCoordinator signatures and the headerless `RouteByPathAndName` call path. Add regression coverage for combined conditions, candidate and prefix fallback, method fallback, header AND/value OR and regex behavior, dynamic snapshot updates, and RPC calls, plus a combined-header snapshot benchmark. **Which issue(s) this PR fixes**: Related failing regression: `TestHeaderGETMissingB` in apache/dubbo-go-pixiu-samples#158. **Special notes for your reviewer**: - Based on official `develop` at `42c72431c93dbd5fa7939fb3583ba56b8ef6ceaf`. - The regression fails against the base implementation for absent/missing/wrong headers. The repaired router/trie/model packages pass all 43 top-level tests (88 including subtests) with Go 1.25.0, `-race`, `-gcflags=-l`, and `-count=1`. - golangci-lint v2.4.0 reports 0 issues; license headers, gofmt/import formatting, and `git diff --check` pass. - Real HTTP traffic checks return 404 with `Route not found` for missing X-B, no headers, and a wrong value; combined-header, header-only, and regex positive cases return 200. - The whole-repository Go 1.25.0 race/coverage run is **not green**: 83 packages pass, while `pkg/cluster/healthcheck` fails `TestCheckTcpConn/failed_connection_due_to_invalid_address_format` because `"invalid address":80` unexpectedly connects on the local machine. This failure remains disclosed and is outside the changed files. - On one Apple M4 host with the same Go 1.25.0 toolchain, median existing read benchmark results are 24,678 -> 24,548 ns/op, 300 -> 326 B/op, and 6 -> 6 allocs/op (3 samples). The 10,000-rule combined-header snapshot benchmark changes from 4,642,746 -> 5,410,596 ns/op, 7,353,931 -> 9,790,772 B/op, and 120,091 -> 140,124 allocs/op (5 samples, 10 iterations each). Snapshots now store the previously discarded conditions and candidates. These short runs do not establish statistically significant read throughput changes or production latency. **Does this PR introduce a user-facing change?**: ```release-note HTTP path and prefix routes now enforce their configured header conditions and can fall back to another matching candidate or path when those conditions are not met. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
