You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "hysuuuu (via GitHub)" <gi...@apache.org> on 2026/08/24 04:37:08 UTC
[PR] fix(polaris): resolve nil pointer panic on startup and route miss (#3303) [dubbo-go]
hysuuuu opened a new pull request, #3697:
URL: https://github.com/apache/dubbo-go/pull/3697
Fixes #3303
### Background
Configuring Polaris route rules without a catch-all fallback crashes the dubbo-go consumer with a nil pointer panic. This happens in two places:
- **Startup:** Polaris attempts to filter instances before any RPC `uid` exists, rejecting all providers and failing initialization.
- **Runtime:** If a request misses the configured route rules, the router returns an empty list, causing `failfast` (and other cluster invokers) to panic on a nil invoker.
### Changes
- Disable route filtering during directory initialization.
- Fall back to all instances in polarisRouter.Route on route miss.
- Add nil guards to failfast/failsafe/failback cluster
--
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] fix(polaris): resolve nil pointer panic on startup and route miss (#3303) [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on code in PR #3697:
URL: https://github.com/apache/dubbo-go/pull/3697#discussion_r3841225971
##########
cluster/cluster/failfast/cluster_invoker.go:
##########
@@ -54,5 +55,8 @@ func (invoker *failfastClusterInvoker) Invoke(ctx context.Context, invocation pr
}
ivk := invoker.DoSelect(loadbalance, invocation, invokers, nil)
+ if ivk == nil {
+ return &result.RPCResult{Err: fmt.Errorf("invoker is nil")}
Review Comment:
if you don't need to format the str, just use the `errors.New`
--
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] fix(polaris): resolve nil pointer panic on startup and route miss (#3303) [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3697:
URL: https://github.com/apache/dubbo-go/pull/3697#issuecomment-5391482239
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3697) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3697&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3697&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3697&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=3697)
--
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] fix(polaris): resolve nil pointer panic on startup and route miss (#3303) [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl merged PR #3697:
URL: https://github.com/apache/dubbo-go/pull/3697
--
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] fix(polaris): resolve nil pointer panic on startup and route miss (#3303) [dubbo-go]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3697:
URL: https://github.com/apache/dubbo-go/pull/3697#issuecomment-5390842885
## [Codecov](https://app.codecov.io/gh/apache/dubbo-go/pull/3697?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 `27.27273%` with `8 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 56.16%. 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 ([`8a5ab1b`](https://app.codecov.io/gh/apache/dubbo-go/commit/8a5ab1b8d5031fe1908a48623245ec9a05328284?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 952 commits behind head on develop.
| [Files with missing lines](https://app.codecov.io/gh/apache/dubbo-go/pull/3697?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/polaris/router.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3697?src=pr&el=tree&filepath=cluster%2Frouter%2Fpolaris%2Frouter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2x1c3Rlci9yb3V0ZXIvcG9sYXJpcy9yb3V0ZXIuZ28=) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3697?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [cluster/cluster/failback/cluster\_invoker.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3697?src=pr&el=tree&filepath=cluster%2Fcluster%2Ffailback%2Fcluster_invoker.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2x1c3Rlci9jbHVzdGVyL2ZhaWxiYWNrL2NsdXN0ZXJfaW52b2tlci5nbw==) | 0.00% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3697?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [cluster/cluster/failsafe/cluster\_invoker.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3697?src=pr&el=tree&filepath=cluster%2Fcluster%2Ffailsafe%2Fcluster_invoker.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2x1c3Rlci9jbHVzdGVyL2ZhaWxzYWZlL2NsdXN0ZXJfaW52b2tlci5nbw==) | 0.00% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3697?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 #3697 +/- ##
===========================================
+ Coverage 46.76% 56.16% +9.40%
===========================================
Files 295 475 +180
Lines 17172 37396 +20224
===========================================
+ Hits 8031 21005 +12974
- Misses 8287 14746 +6459
- Partials 854 1645 +791
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/dubbo-go/pull/3697?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] fix(polaris): resolve nil pointer panic on startup and route miss (#3303) [dubbo-go]
Posted by "hysuuuu (via GitHub)" <gi...@apache.org>.
hysuuuu commented on code in PR #3697:
URL: https://github.com/apache/dubbo-go/pull/3697#discussion_r3841104062
##########
cluster/cluster/failback/cluster_invoker.go:
##########
@@ -31,6 +31,8 @@ import (
"github.com/cenkalti/backoff/v4"
"github.com/dubbogo/gost/log/logger"
+
+ perrors "github.com/pkg/errors"
Review Comment:
Updated. Thanks for the feedback.
##########
cluster/cluster/failback/cluster_invoker.go:
##########
@@ -190,6 +192,9 @@ func (invoker *failbackClusterInvoker) Invoke(ctx context.Context, invocation pr
invoked := make([]protocolbase.Invoker, 0, len(invokers))
ivk := invoker.DoSelect(loadBalance, invocation, invokers, invoked)
// DO INVOKE
+ if ivk == nil {
+ return &result.RPCResult{Err: perrors.New("invoker is nil")}
Review Comment:
Updated. Thanks for the feedback.
--
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] fix(polaris): resolve nil pointer panic on startup and route miss (#3303) [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3697:
URL: https://github.com/apache/dubbo-go/pull/3697#issuecomment-5391797946
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3697) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3697&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3697&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3697&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=3697)
--
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] fix(polaris): resolve nil pointer panic on startup and route miss (#3303) [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3697:
URL: https://github.com/apache/dubbo-go/pull/3697#issuecomment-5390800160
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3697) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3697&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3697&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3697&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=3697)
--
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] fix(polaris): resolve nil pointer panic on startup and route miss (#3303) [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on code in PR #3697:
URL: https://github.com/apache/dubbo-go/pull/3697#discussion_r3840998902
##########
cluster/cluster/failback/cluster_invoker.go:
##########
@@ -190,6 +192,9 @@ func (invoker *failbackClusterInvoker) Invoke(ctx context.Context, invocation pr
invoked := make([]protocolbase.Invoker, 0, len(invokers))
ivk := invoker.DoSelect(loadBalance, invocation, invokers, invoked)
// DO INVOKE
+ if ivk == nil {
+ return &result.RPCResult{Err: perrors.New("invoker is nil")}
Review Comment:
use fmt.Error(f)
##########
cluster/cluster/failback/cluster_invoker.go:
##########
@@ -31,6 +31,8 @@ import (
"github.com/cenkalti/backoff/v4"
"github.com/dubbogo/gost/log/logger"
+
+ perrors "github.com/pkg/errors"
Review Comment:
use "errors" instead of "pkg/errors"
--
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] fix(polaris): resolve nil pointer panic on startup and route miss (#3303) [dubbo-go]
Posted by "hysuuuu (via GitHub)" <gi...@apache.org>.
hysuuuu commented on code in PR #3697:
URL: https://github.com/apache/dubbo-go/pull/3697#discussion_r3841285358
##########
cluster/cluster/failfast/cluster_invoker.go:
##########
@@ -54,5 +55,8 @@ func (invoker *failfastClusterInvoker) Invoke(ctx context.Context, invocation pr
}
ivk := invoker.DoSelect(loadbalance, invocation, invokers, nil)
+ if ivk == nil {
+ return &result.RPCResult{Err: fmt.Errorf("invoker is nil")}
Review Comment:
Updated.
--
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