You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "wyf027 (via GitHub)" <gi...@apache.org> on 2026/07/14 06:21:43 UTC
[PR] feat(router): support static affinity router config [dubbo-go]
wyf027 opened a new pull request, #3490:
URL: https://github.com/apache/dubbo-go/pull/3490
## What
- Add `AffinityAware` to static `RouterConfig` and preserve it when configs are cloned.
- Implement `SetStaticConfig` for service- and application-scoped affinity routers.
- Keep multiple static affinity rules isolated by config key and apply them deterministically.
- Preserve bootstrap static rules when config center has no dynamic rule.
- Cover valid, invalid, disabled, scope-filtered, multi-rule, and fallback behavior.
## Why
Issue #3203 identifies static AffinityRouter configuration as an outstanding router gap. The affinity router supported dynamic config-center rules, but the static router injection path had neither affinity fields nor a `StaticConfigSetter` implementation.
This recreates the maintainer-approved final state of #3420 on the latest `develop`, while omitting compatibility files that have since been removed upstream. The original PR cannot be reopened because its fork/head repository was deleted.
## User impact
Applications can bootstrap service- or application-scoped affinity routing locally through `client.WithRouter`. Multiple rules remain independent, and an absent dynamic rule no longer erases static configuration.
## Validation
- `GOTOOLCHAIN=go1.25.0+auto go test ./cluster/router/affinity ./global ./cluster/router/... .`
- `go test -race ./cluster/router/affinity`
- `go vet ./cluster/router/affinity ./global ./cluster/router/... .`
- `golangci-lint run ./cluster/router/affinity ./global --timeout=10m`
- `make check-fmt`
- `git diff origin/develop...HEAD --check`
## Documentation
The previously requested website follow-up, apache/dubbo-website#3211, was also closed after its head repository was deleted and will need to be recreated separately. This PR remains a draft while that follow-up is outstanding.
Refs #3203
Supersedes #3420
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(router): support static affinity router config [dubbo-go]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3490:
URL: https://github.com/apache/dubbo-go/pull/3490#issuecomment-4966043150
## [Codecov](https://app.codecov.io/gh/apache/dubbo-go/pull/3490?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `91.30435%` with `6 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 54.50%. Comparing base ([`60d1c2a`](https://app.codecov.io/gh/apache/dubbo-go/commit/60d1c2a949f0ee0da4be3fe09fb79d295491e040?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`ad9681a`](https://app.codecov.io/gh/apache/dubbo-go/commit/ad9681a03a14aaeb0261f1f661ef0b2e90e69593?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 872 commits behind head on develop.
| [Files with missing lines](https://app.codecov.io/gh/apache/dubbo-go/pull/3490?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [cluster/router/affinity/router.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3490?src=pr&el=tree&filepath=cluster%2Frouter%2Faffinity%2Frouter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2x1c3Rlci9yb3V0ZXIvYWZmaW5pdHkvcm91dGVyLmdv) | 91.17% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3490?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## develop #3490 +/- ##
===========================================
+ Coverage 46.76% 54.50% +7.73%
===========================================
Files 295 462 +167
Lines 17172 35596 +18424
===========================================
+ Hits 8031 19400 +11369
- Misses 8287 14669 +6382
- Partials 854 1527 +673
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/dubbo-go/pull/3490?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(router): support static affinity router config [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl closed pull request #3490: feat(router): support static affinity router config
URL: https://github.com/apache/dubbo-go/pull/3490
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(router): support static affinity router config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3490:
URL: https://github.com/apache/dubbo-go/pull/3490#issuecomment-4966085832
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3490) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3490&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3490&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3490&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3490&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3490&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3490)
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(router): support static affinity router config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3490:
URL: https://github.com/apache/dubbo-go/pull/3490#issuecomment-4966018371
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3490) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3490&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3490&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3490&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3490&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3490&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3490)
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org