You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "KamToHung (via GitHub)" <gi...@apache.org> on 2025/09/20 08:10:11 UTC
[PR] optimize config.GetConsumerServiceByInterfaceName [dubbo-go]
KamToHung opened a new pull request, #3034:
URL: https://github.com/apache/dubbo-go/pull/3034
…holder function
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung closed pull request #3034: optimize config
URL: https://github.com/apache/dubbo-go/pull/3034
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3451525671
> 现在好像是由于冲突问题ci没运行,先解决一下冲突问题,看一下ci结果
已处理
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3448449489
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [21 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [13.8% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3394344551
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [22 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [10.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3417720916
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [16 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [1.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3419725349
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [12 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [0.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2445016274
##########
protocol/grpc/server.go:
##########
@@ -199,14 +224,16 @@ func waitGrpcExporter(providerServices map[string]*config.ServiceConfig) {
}
// registerService SetProxyImpl invoker and grpc service
-func registerService(providerServices map[string]*config.ServiceConfig, server *grpc.Server) {
+// TODO #2741 old config compatibility
+func registerService(providerServices map[string]*global.ServiceConfig, server *grpc.Server) {
for key, providerService := range providerServices {
+
+ //TODO: Temporary compatibility with old APIs, can be removed later
service := config.GetProviderService(key)
Review Comment:
这行对config的依赖在后文并没有看到替代的地方
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3451533026
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [21 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [13.8% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "nanjiek (via GitHub)" <gi...@apache.org>.
nanjiek commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2442465394
##########
server/server.go:
##########
@@ -39,13 +39,21 @@ import (
)
// proServices are for internal services
-var proServices = make([]*InternalService, 0, 16)
-var proLock sync.Mutex
+var internalProServices = make([]*InternalService, 0, 16)
+var internalProLock sync.Mutex
type Server struct {
cfg *ServerOptions
- svcOptsMap sync.Map
+ mu sync.RWMutex
+ // key: *ServiceOptions, value: *common.ServiceInfo
+ //proServices map[string]common.RPCService
+ // change any to *common.ServiceInfo @see config/service.go
+ svcOptsMap map[string]*ServiceOptions
+ // key is interface name, value is *ServiceOptions
+ interfaceNameServices map[string]*ServiceOptions
+ // indicate whether the server is already started
+ serve bool
}
Review Comment:
The type assertion to interface{} is unnecessary because every type in Go implements interface{}.
This means the assertion will always succeed, and ok will always be true.
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3419775734
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [12 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [0.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2444769040
##########
protocol/grpc/server.go:
##########
@@ -150,22 +151,33 @@ func (s *Server) Start(url *common.URL) {
s.grpcServer = server
go func() {
- providerServices := config.GetProviderConfig().Services
-
- if len(providerServices) == 0 {
- panic("provider service map is null")
- }
- // wait all exporter ready , then set proxy impl and grpc registerService
+ providerServices := s.getProviderServices(url)
+ // wait all exporter ready, then set proxy impl and grpc registerService
waitGrpcExporter(providerServices)
registerService(providerServices, server)
reflection.Register(server)
-
- if err = server.Serve(lis); err != nil {
+ if err := server.Serve(lis); err != nil {
logger.Errorf("server serve failed with err: %v", err)
}
}()
}
+// getProviderServices retrieves provider services from config or URL attributes
+func (s *Server) getProviderServices(url *common.URL) map[string]*global.ServiceConfig {
+ providerServices := config.GetProviderConfig().Services
+ if len(providerServices) > 0 {
+ return convertServiceMap(providerServices)
+ }
+ // TODO #2741 old config compatibility
+ if providerConfRaw, ok := url.GetAttribute(constant.ProviderConfigKey); ok {
+ if providerConf, ok := providerConfRaw.(*global.ProviderConfig); ok && providerConf != nil {
+ return providerConf.Services
+ }
+ panic("illegal provider config")
Review Comment:
> 尽量不要在 dubbogo 这种 sdk 中使用 panic,尽量使用 error
好,我修复下
--
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] optimize config [dubbo-go]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2443738370
##########
common/extension/registry_directory.go:
##########
@@ -43,22 +43,22 @@ func SetDirectory(key string, v registryDirectory) {
}
// GetDefaultRegistryDirectory finds the registryDirectory with url and registry
-func GetDefaultRegistryDirectory(config *common.URL, registry registry.Registry) (directory.Directory, error) {
+func GetDefaultRegistryDirectory(url *common.URL, registry registry.Registry) (directory.Directory, error) {
Review Comment:
这块变量名称,可能是按照 dubbo 写的,你把 dubbo 相关的代码找找看下。感觉没必要改。
--
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] optimize config.GetConsumerServiceByInterfaceName [dubbo-go]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2365561283
##########
protocol/grpc/client.go:
##########
@@ -139,8 +139,12 @@ func NewClient(url *common.URL) (*Client, error) {
}
key := url.GetParam(constant.InterfaceKey, "")
- impl := config.GetConsumerServiceByInterfaceName(key)
- invoker := getInvoker(impl, conn)
+ //TODO: Temporary compatibility with old APIs, can be removed later
+ consumerService := config.GetConsumerServiceByInterfaceName(key)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
+ }
Review Comment:
This is identical logic to the triple protocol implementation. Consider extracting this consumer service resolution logic into a shared utility function to avoid code duplication.
##########
protocol/triple/dubbo3_invoker.go:
##########
@@ -80,7 +80,11 @@ func NewDubbo3Invoker(url *common.URL) (*DubboInvoker, error) {
// for triple pb serialization. The bean name from provider is the provider reference key,
// which can't locate the target consumer stub, so we use interface key..
interfaceKey := url.GetParam(constant.InterfaceKey, "")
+ //TODO: Temporary compatibility with old APIs, can be removed later
consumerService := config.GetConsumerServiceByInterfaceName(interfaceKey)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
+ }
Review Comment:
[nitpick] The TODO comment indicates this is temporary code for backward compatibility. Consider adding a timeline or version number for when this can be removed, and ensure there's a plan to migrate away from the old API.
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3419693611
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [12 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [1.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2444768571
##########
common/extension/registry_directory.go:
##########
@@ -43,22 +43,22 @@ func SetDirectory(key string, v registryDirectory) {
}
// GetDefaultRegistryDirectory finds the registryDirectory with url and registry
-func GetDefaultRegistryDirectory(config *common.URL, registry registry.Registry) (directory.Directory, error) {
+func GetDefaultRegistryDirectory(url *common.URL, registry registry.Registry) (directory.Directory, error) {
Review Comment:
> 这块变量名称,可能是按照 dubbo 写的,你把 dubbo 相关的代码找找看下。感觉没必要改。
查了下dubbo项目,URL变量名都用了url
--
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] optimize config [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2444993506
##########
protocol/dubbo3/internal/client.go:
##########
@@ -21,6 +21,7 @@ import (
"dubbo.apache.org/dubbo-go/v3/config"
)
+// TODO: After the config is removed, remove the test
func init() {
// for pb client
Review Comment:
pls add corresponding test in new api
##########
protocol/dubbo3/internal/server.go:
##########
Review Comment:
pls add corresponding test in new api
##########
protocol/grpc/server.go:
##########
@@ -199,14 +224,16 @@ func waitGrpcExporter(providerServices map[string]*config.ServiceConfig) {
}
// registerService SetProxyImpl invoker and grpc service
-func registerService(providerServices map[string]*config.ServiceConfig, server *grpc.Server) {
+// TODO #2741 old config compatibility
+func registerService(providerServices map[string]*global.ServiceConfig, server *grpc.Server) {
for key, providerService := range providerServices {
+
+ //TODO: Temporary compatibility with old APIs, can be removed later
service := config.GetProviderService(key)
Review Comment:
这行对config的依赖似乎并没有解除
##########
protocol/grpc/server.go:
##########
@@ -150,22 +151,37 @@ func (s *Server) Start(url *common.URL) {
s.grpcServer = server
go func() {
- providerServices := config.GetProviderConfig().Services
-
- if len(providerServices) == 0 {
- panic("provider service map is null")
+ providerServices := s.getProviderServices(url)
+ if providerServices == nil {
+ logger.Error("no provider service found")
+ return
}
- // wait all exporter ready , then set proxy impl and grpc registerService
+ // wait all exporter ready, then set proxy impl and grpc registerService
waitGrpcExporter(providerServices)
registerService(providerServices, server)
reflection.Register(server)
-
- if err = server.Serve(lis); err != nil {
+ if err := server.Serve(lis); err != nil {
logger.Errorf("server serve failed with err: %v", err)
}
}()
}
+// getProviderServices retrieves provider services from config or URL attributes
+func (s *Server) getProviderServices(url *common.URL) map[string]*global.ServiceConfig {
Review Comment:
why this func has a `(s *Server)` receiver? `s` seems unuse
##########
protocol/grpc/client.go:
##########
@@ -166,28 +174,35 @@ func clientInit() {
}
}()
- if rootConfig.Application == nil {
- return
- }
Review Comment:
why the check for application is deleted
--
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] optimize config [dubbo-go]
Posted by "nanjiek (via GitHub)" <gi...@apache.org>.
nanjiek commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2445523724
##########
protocol/grpc/server.go:
##########
@@ -199,14 +224,16 @@ func waitGrpcExporter(providerServices map[string]*config.ServiceConfig) {
}
// registerService SetProxyImpl invoker and grpc service
-func registerService(providerServices map[string]*config.ServiceConfig, server *grpc.Server) {
+// TODO #2741 old config compatibility
+func registerService(providerServices map[string]*global.ServiceConfig, server *grpc.Server) {
for key, providerService := range providerServices {
+
+ //TODO: Temporary compatibility with old APIs, can be removed later
service := config.GetProviderService(key)
Review Comment:
这是对于config的兼容,替代在前面
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3341800428
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [1.8% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3405101859
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [20 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [1.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3538746382
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [21 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [13.9% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3341474622
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [2.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3341888679
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [7 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [1.6% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3538744123
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [21 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [13.9% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "nanjiek (via GitHub)" <gi...@apache.org>.
nanjiek commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2442465394
##########
server/server.go:
##########
@@ -39,13 +39,21 @@ import (
)
// proServices are for internal services
-var proServices = make([]*InternalService, 0, 16)
-var proLock sync.Mutex
+var internalProServices = make([]*InternalService, 0, 16)
+var internalProLock sync.Mutex
type Server struct {
cfg *ServerOptions
- svcOptsMap sync.Map
+ mu sync.RWMutex
+ // key: *ServiceOptions, value: *common.ServiceInfo
+ //proServices map[string]common.RPCService
+ // change any to *common.ServiceInfo @see config/service.go
+ svcOptsMap map[string]*ServiceOptions
+ // key is interface name, value is *ServiceOptions
+ interfaceNameServices map[string]*ServiceOptions
+ // indicate whether the server is already started
+ serve bool
}
Review Comment:
The type assertion to interface{} is unnecessary because every type in Go implements interface{}.
This means the assertion will always succeed, and ok will always be true.
--
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] optimize config [dubbo-go]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2443739284
##########
protocol/grpc/server.go:
##########
@@ -150,22 +151,33 @@ func (s *Server) Start(url *common.URL) {
s.grpcServer = server
go func() {
- providerServices := config.GetProviderConfig().Services
-
- if len(providerServices) == 0 {
- panic("provider service map is null")
- }
- // wait all exporter ready , then set proxy impl and grpc registerService
+ providerServices := s.getProviderServices(url)
+ // wait all exporter ready, then set proxy impl and grpc registerService
waitGrpcExporter(providerServices)
registerService(providerServices, server)
reflection.Register(server)
-
- if err = server.Serve(lis); err != nil {
+ if err := server.Serve(lis); err != nil {
logger.Errorf("server serve failed with err: %v", err)
}
}()
}
+// getProviderServices retrieves provider services from config or URL attributes
+func (s *Server) getProviderServices(url *common.URL) map[string]*global.ServiceConfig {
+ providerServices := config.GetProviderConfig().Services
+ if len(providerServices) > 0 {
+ return convertServiceMap(providerServices)
+ }
+ // TODO #2741 old config compatibility
+ if providerConfRaw, ok := url.GetAttribute(constant.ProviderConfigKey); ok {
+ if providerConf, ok := providerConfRaw.(*global.ProviderConfig); ok && providerConf != nil {
+ return providerConf.Services
+ }
+ panic("illegal provider config")
Review Comment:
尽量不要在 dubbogo 这种 sdk 中使用 panic,尽量使用 error
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3421925857
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [12 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [0.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3448492301
ci check need reslove conflict first
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2379835988
##########
protocol/grpc/client.go:
##########
@@ -152,7 +154,7 @@ func NewClient(url *common.URL) (*Client, error) {
}, nil
}
-func clientInit() {
+func clientInit(url *common.URL) {
Review Comment:
> 这里添加一个 url param 干啥?
从上层把参数set进url后续使用,现在还没改好,pr我先Draft
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3411809061
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [20 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [1.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "nanjiek (via GitHub)" <gi...@apache.org>.
nanjiek commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2442463029
##########
server/server.go:
##########
@@ -39,13 +39,21 @@ import (
)
// proServices are for internal services
-var proServices = make([]*InternalService, 0, 16)
-var proLock sync.Mutex
+var internalProServices = make([]*InternalService, 0, 16)
+var internalProLock sync.Mutex
type Server struct {
cfg *ServerOptions
- svcOptsMap sync.Map
+ mu sync.RWMutex
+ // key: *ServiceOptions, value: *common.ServiceInfo
+ //proServices map[string]common.RPCService
+ // change any to *common.ServiceInfo @see config/service.go
+ svcOptsMap map[string]*ServiceOptions
+ // key is interface name, value is *ServiceOptions
+ interfaceNameServices map[string]*ServiceOptions
+ // indicate whether the server is already started
+ serve bool
}
Review Comment:
The introduction of mu and the switch from sync.Map to map + RWMutex require stress testing to verify concurrency performance under load.
##########
protocol/grpc/client.go:
##########
@@ -139,8 +139,12 @@ func NewClient(url *common.URL) (*Client, error) {
}
key := url.GetParam(constant.InterfaceKey, "")
- impl := config.GetConsumerServiceByInterfaceName(key)
- invoker := getInvoker(impl, conn)
+ //TODO: Temporary compatibility with old APIs, can be removed later
+ consumerService := config.GetConsumerServiceByInterfaceName(key)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
Review Comment:
Don't use interface{},please use any.Starting from Go 1.18, which added support for generics, the Go community and the official style guidelines recommend using any rather than interface{} when you want to express that a value can be of any type. Although both are functionally identical (any is just a type alias for interface{}), any reads more naturally in generic constraints and makes the code easier to understand.
--
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] optimize config [dubbo-go]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2443737321
##########
client/options.go:
##########
@@ -937,6 +947,12 @@ func SetClientTLS(tls *global.TLSConfig) ClientOption {
}
}
+func SetProtocols(protocols map[string]*global.ProtocolConfig) ClientOption {
Review Comment:
add comment
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2443348864
##########
server/server.go:
##########
@@ -39,13 +39,21 @@ import (
)
// proServices are for internal services
-var proServices = make([]*InternalService, 0, 16)
-var proLock sync.Mutex
+var internalProServices = make([]*InternalService, 0, 16)
+var internalProLock sync.Mutex
type Server struct {
cfg *ServerOptions
- svcOptsMap sync.Map
+ mu sync.RWMutex
+ // key: *ServiceOptions, value: *common.ServiceInfo
+ //proServices map[string]common.RPCService
+ // change any to *common.ServiceInfo @see config/service.go
+ svcOptsMap map[string]*ServiceOptions
+ // key is interface name, value is *ServiceOptions
+ interfaceNameServices map[string]*ServiceOptions
+ // indicate whether the server is already started
+ serve bool
}
Review Comment:
> The introduction of mu and the switch from sync.Map to map + RWMutex require stress testing to verify concurrency performance under load.
I think that registering a service happens during project startup. In most cases, you wouldn't actively register a service after startup activities, so there's basically no concurrency issue here. The lock is just added for code robustness.
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2443349410
##########
protocol/grpc/client.go:
##########
@@ -139,8 +139,12 @@ func NewClient(url *common.URL) (*Client, error) {
}
key := url.GetParam(constant.InterfaceKey, "")
- impl := config.GetConsumerServiceByInterfaceName(key)
- invoker := getInvoker(impl, conn)
+ //TODO: Temporary compatibility with old APIs, can be removed later
+ consumerService := config.GetConsumerServiceByInterfaceName(key)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
+ }
Review Comment:
In Diff case
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3424379198
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [12 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [0.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3424529445
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [12 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [0.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3538747315
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [21 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [13.9% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3538684321
pls fix conflict
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3419755112
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [12 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [0.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2443737473
##########
client/options.go:
##########
@@ -478,6 +480,12 @@ func setTLS(tls *global.TLSConfig) ReferenceOption {
}
}
+func setProtocols(protocols map[string]*global.ProtocolConfig) ReferenceOption {
Review Comment:
add comment
--
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] optimize config [dubbo-go]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks merged PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3329942446
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [3.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3329941428
WIP
--
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] optimize config.GetConsumerServiceByInterfaceName [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3314758549
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3394322981
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [22 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [8.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config.GetConsumerServiceByInterfaceName [dubbo-go]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3314860193
## [Codecov](https://app.codecov.io/gh/apache/dubbo-go/pull/3034?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 `30.00000%` with `7 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 39.63%. Comparing base ([`53b4f39`](https://app.codecov.io/gh/apache/dubbo-go/commit/53b4f39f35fba8acf957aaf556c044d4e4775b46?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3c13992`](https://app.codecov.io/gh/apache/dubbo-go/commit/3c1399218398ecfbf7a8bf92a0cbc151b6a14f06?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 7 commits behind head on develop.
| [Files with missing lines](https://app.codecov.io/gh/apache/dubbo-go/pull/3034?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [protocol/triple/dubbo3\_invoker.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3034?src=pr&el=tree&filepath=protocol%2Ftriple%2Fdubbo3_invoker.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHJvdG9jb2wvdHJpcGxlL2R1YmJvM19pbnZva2VyLmdv) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3034?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [protocol/grpc/client.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3034?src=pr&el=tree&filepath=protocol%2Fgrpc%2Fclient.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHJvdG9jb2wvZ3JwYy9jbGllbnQuZ28=) | 50.00% | [2 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3034?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 #3034 +/- ##
=========================================
Coverage 39.62% 39.63%
=========================================
Files 457 457
Lines 38878 39056 +178
=========================================
+ Hits 15406 15478 +72
- Misses 22214 22317 +103
- Partials 1258 1261 +3
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo-go/pull/3034?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] optimize config [dubbo-go]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2377428329
##########
protocol/grpc/client.go:
##########
@@ -152,7 +154,7 @@ func NewClient(url *common.URL) (*Client, error) {
}, nil
}
-func clientInit() {
+func clientInit(url *common.URL) {
Review Comment:
这里添加一个 url param 干啥?
--
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] optimize config.GetConsumerServiceByInterfaceName [dubbo-go]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2365561963
##########
protocol/grpc/client.go:
##########
@@ -139,8 +139,12 @@ func NewClient(url *common.URL) (*Client, error) {
}
key := url.GetParam(constant.InterfaceKey, "")
- impl := config.GetConsumerServiceByInterfaceName(key)
- invoker := getInvoker(impl, conn)
+ //TODO: Temporary compatibility with old APIs, can be removed later
+ consumerService := config.GetConsumerServiceByInterfaceName(key)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
Review Comment:
The code doesn't validate that `rpcService` is of the expected type before assignment. Consider adding type assertion to ensure the attribute value is compatible with the expected consumer service interface.
```suggestion
typedService, ok := rpcService.(interface{})
if !ok {
logger.Errorf("rpcService does not implement the expected consumer service interface")
return nil, errors.New("rpcService does not implement the expected consumer service interface")
}
consumerService = typedService
```
##########
protocol/triple/dubbo3_invoker.go:
##########
@@ -80,7 +80,11 @@ func NewDubbo3Invoker(url *common.URL) (*DubboInvoker, error) {
// for triple pb serialization. The bean name from provider is the provider reference key,
// which can't locate the target consumer stub, so we use interface key..
interfaceKey := url.GetParam(constant.InterfaceKey, "")
+ //TODO: Temporary compatibility with old APIs, can be removed later
consumerService := config.GetConsumerServiceByInterfaceName(interfaceKey)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
Review Comment:
The code doesn't validate that `rpcService` is of the expected type before assignment. Consider adding type assertion to ensure the attribute value is compatible with the expected consumer service interface.
```suggestion
typedService, ok := rpcService.(interface{})
if !ok {
return nil, errors.New("rpcService attribute is not of the expected type")
}
consumerService = typedService
```
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3538752496
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [21 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [13.9% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3330016587
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [2.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3419763781
PTAL
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3419754031
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [13 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [0.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3419711483
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [12 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [0.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3394422666
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [21 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [1.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3451619853
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [21 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [13.9% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3451570584
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [21 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [13.9% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3563023134
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [27 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [8.9% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "nanjiek (via GitHub)" <gi...@apache.org>.
nanjiek commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2442466438
##########
server/server.go:
##########
@@ -39,13 +39,21 @@ import (
)
// proServices are for internal services
-var proServices = make([]*InternalService, 0, 16)
-var proLock sync.Mutex
+var internalProServices = make([]*InternalService, 0, 16)
+var internalProLock sync.Mutex
type Server struct {
cfg *ServerOptions
- svcOptsMap sync.Map
+ mu sync.RWMutex
+ // key: *ServiceOptions, value: *common.ServiceInfo
+ //proServices map[string]common.RPCService
+ // change any to *common.ServiceInfo @see config/service.go
+ svcOptsMap map[string]*ServiceOptions
+ // key is interface name, value is *ServiceOptions
+ interfaceNameServices map[string]*ServiceOptions
+ // indicate whether the server is already started
+ serve bool
}
Review Comment:
The introduction of mu and the switch from sync.Map to map + RWMutex require stress testing to verify concurrency performance under load.
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3421847797
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [12 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [0.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "nanjiek (via GitHub)" <gi...@apache.org>.
nanjiek commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2442463029
##########
server/server.go:
##########
@@ -39,13 +39,21 @@ import (
)
// proServices are for internal services
-var proServices = make([]*InternalService, 0, 16)
-var proLock sync.Mutex
+var internalProServices = make([]*InternalService, 0, 16)
+var internalProLock sync.Mutex
type Server struct {
cfg *ServerOptions
- svcOptsMap sync.Map
+ mu sync.RWMutex
+ // key: *ServiceOptions, value: *common.ServiceInfo
+ //proServices map[string]common.RPCService
+ // change any to *common.ServiceInfo @see config/service.go
+ svcOptsMap map[string]*ServiceOptions
+ // key is interface name, value is *ServiceOptions
+ interfaceNameServices map[string]*ServiceOptions
+ // indicate whether the server is already started
+ serve bool
}
Review Comment:
The introduction of mu and the switch from sync.Map to map + RWMutex require stress testing to verify concurrency performance under load.
##########
protocol/grpc/server.go:
##########
@@ -150,22 +151,35 @@ func (s *Server) Start(url *common.URL) {
s.grpcServer = server
go func() {
- providerServices := config.GetProviderConfig().Services
-
- if len(providerServices) == 0 {
- panic("provider service map is null")
- }
- // wait all exporter ready , then set proxy impl and grpc registerService
+ providerServices := s.getProviderServices(url)
+ // wait all exporter ready, then set proxy impl and grpc registerService
waitGrpcExporter(providerServices)
registerService(providerServices, server)
reflection.Register(server)
-
- if err = server.Serve(lis); err != nil {
+ if err := server.Serve(lis); err != nil {
logger.Errorf("server serve failed with err: %v", err)
}
}()
}
+// getProviderServices retrieves provider services from config or URL attributes
+func (s *Server) getProviderServices(url *common.URL) map[string]*global.ServiceConfig {
+ providerServices := config.GetProviderConfig().Services
+ if len(providerServices) > 0 {
+ return convertServiceMap(providerServices)
+ }
+ // TODO #2741 old config compatibility
+ providerConfRaw, ok := url.GetAttribute(constant.ProviderConfigKey)
+ if !ok {
+ panic("no provider service found")
+ }
+ providerConf, ok := providerConfRaw.(*global.ProviderConfig)
+ if !ok || providerConf == nil {
+ panic("illegal provider config")
+ }
+ return providerConf.Services
Review Comment:
The code could be more concise.
```suggestion
if providerConfRaw, ok := url.GetAttribute(constant.ProviderConfigKey); ok {
if providerConf, ok := providerConfRaw.(*global.ProviderConfig); ok && providerConf != nil {
return providerConf.Services
}
panic("illegal provider config")
}
panic("no provider service found")
```
##########
protocol/triple/dubbo3_invoker.go:
##########
@@ -80,7 +80,11 @@ func NewDubbo3Invoker(url *common.URL) (*DubboInvoker, error) {
// for triple pb serialization. The bean name from provider is the provider reference key,
// which can't locate the target consumer stub, so we use interface key..
interfaceKey := url.GetParam(constant.InterfaceKey, "")
+ //TODO: Temporary compatibility with old APIs, can be removed later
consumerService := config.GetConsumerServiceByInterfaceName(interfaceKey)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
Review Comment:
It‘s the same problem I found before.
##########
protocol/grpc/client.go:
##########
@@ -139,8 +139,12 @@ func NewClient(url *common.URL) (*Client, error) {
}
key := url.GetParam(constant.InterfaceKey, "")
- impl := config.GetConsumerServiceByInterfaceName(key)
- invoker := getInvoker(impl, conn)
+ //TODO: Temporary compatibility with old APIs, can be removed later
+ consumerService := config.GetConsumerServiceByInterfaceName(key)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
Review Comment:
The type assertion to interface{} is unnecessary because every type in Go implements interface{}.
This means the assertion will always succeed, and ok will always be true.
##########
protocol/grpc/client.go:
##########
@@ -139,8 +139,12 @@ func NewClient(url *common.URL) (*Client, error) {
}
key := url.GetParam(constant.InterfaceKey, "")
- impl := config.GetConsumerServiceByInterfaceName(key)
- invoker := getInvoker(impl, conn)
+ //TODO: Temporary compatibility with old APIs, can be removed later
+ consumerService := config.GetConsumerServiceByInterfaceName(key)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
Review Comment:
Don't use interface{},please use any.Starting from Go 1.18, which added support for generics, the Go community and the official style guidelines recommend using any rather than interface{} when you want to express that a value can be of any type. Although both are functionally identical (any is just a type alias for interface{}), any reads more naturally in generic constraints and makes the code easier to understand.
--
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] optimize config [dubbo-go]
Posted by "nanjiek (via GitHub)" <gi...@apache.org>.
nanjiek commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2442447693
##########
protocol/triple/dubbo3_invoker.go:
##########
@@ -80,7 +80,11 @@ func NewDubbo3Invoker(url *common.URL) (*DubboInvoker, error) {
// for triple pb serialization. The bean name from provider is the provider reference key,
// which can't locate the target consumer stub, so we use interface key..
interfaceKey := url.GetParam(constant.InterfaceKey, "")
+ //TODO: Temporary compatibility with old APIs, can be removed later
consumerService := config.GetConsumerServiceByInterfaceName(interfaceKey)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
Review Comment:
It‘s the same problem I found before.
--
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] optimize config [dubbo-go]
Posted by "nanjiek (via GitHub)" <gi...@apache.org>.
nanjiek commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2442444478
##########
protocol/grpc/client.go:
##########
@@ -139,8 +139,12 @@ func NewClient(url *common.URL) (*Client, error) {
}
key := url.GetParam(constant.InterfaceKey, "")
- impl := config.GetConsumerServiceByInterfaceName(key)
- invoker := getInvoker(impl, conn)
+ //TODO: Temporary compatibility with old APIs, can be removed later
+ consumerService := config.GetConsumerServiceByInterfaceName(key)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
Review Comment:
The type assertion to interface{} is unnecessary because every type in Go implements interface{}.
This means the assertion will always succeed, and ok will always be true.
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2443329620
##########
protocol/grpc/server.go:
##########
@@ -150,22 +151,35 @@ func (s *Server) Start(url *common.URL) {
s.grpcServer = server
go func() {
- providerServices := config.GetProviderConfig().Services
-
- if len(providerServices) == 0 {
- panic("provider service map is null")
- }
- // wait all exporter ready , then set proxy impl and grpc registerService
+ providerServices := s.getProviderServices(url)
+ // wait all exporter ready, then set proxy impl and grpc registerService
waitGrpcExporter(providerServices)
registerService(providerServices, server)
reflection.Register(server)
-
- if err = server.Serve(lis); err != nil {
+ if err := server.Serve(lis); err != nil {
logger.Errorf("server serve failed with err: %v", err)
}
}()
}
+// getProviderServices retrieves provider services from config or URL attributes
+func (s *Server) getProviderServices(url *common.URL) map[string]*global.ServiceConfig {
+ providerServices := config.GetProviderConfig().Services
+ if len(providerServices) > 0 {
+ return convertServiceMap(providerServices)
+ }
+ // TODO #2741 old config compatibility
+ providerConfRaw, ok := url.GetAttribute(constant.ProviderConfigKey)
+ if !ok {
+ panic("no provider service found")
+ }
+ providerConf, ok := providerConfRaw.(*global.ProviderConfig)
+ if !ok || providerConf == nil {
+ panic("illegal provider config")
+ }
+ return providerConf.Services
Review Comment:
Thanks,I fix it
##########
protocol/grpc/server.go:
##########
@@ -150,22 +151,35 @@ func (s *Server) Start(url *common.URL) {
s.grpcServer = server
go func() {
- providerServices := config.GetProviderConfig().Services
-
- if len(providerServices) == 0 {
- panic("provider service map is null")
- }
- // wait all exporter ready , then set proxy impl and grpc registerService
+ providerServices := s.getProviderServices(url)
+ // wait all exporter ready, then set proxy impl and grpc registerService
waitGrpcExporter(providerServices)
registerService(providerServices, server)
reflection.Register(server)
-
- if err = server.Serve(lis); err != nil {
+ if err := server.Serve(lis); err != nil {
logger.Errorf("server serve failed with err: %v", err)
}
}()
}
+// getProviderServices retrieves provider services from config or URL attributes
+func (s *Server) getProviderServices(url *common.URL) map[string]*global.ServiceConfig {
+ providerServices := config.GetProviderConfig().Services
+ if len(providerServices) > 0 {
+ return convertServiceMap(providerServices)
+ }
+ // TODO #2741 old config compatibility
+ providerConfRaw, ok := url.GetAttribute(constant.ProviderConfigKey)
+ if !ok {
+ panic("no provider service found")
+ }
+ providerConf, ok := providerConfRaw.(*global.ProviderConfig)
+ if !ok || providerConf == nil {
+ panic("illegal provider config")
+ }
+ return providerConf.Services
Review Comment:
Thanks, I fix it
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3451528592
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [21 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [13.8% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config.GetConsumerServiceByInterfaceName [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3314922534
WIP
--
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] optimize config.GetConsumerServiceByInterfaceName [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3314857852
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [3 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [8.8% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3329944028
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [3.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2483755208
##########
protocol/dubbo3/internal/client.go:
##########
@@ -21,6 +21,7 @@ import (
"dubbo.apache.org/dubbo-go/v3/config"
)
+// TODO: After the config is removed, remove the test
func init() {
// for pb client
Review Comment:
> pls add corresponding test in new api
dubbo3只有config api方式,现在用new triple代替了。加了TODO后续移除
##########
protocol/dubbo3/internal/server.go:
##########
Review Comment:
> pls add corresponding test in new api
dubbo3只有config api方式,现在用new triple代替了。加了TODO后续移除
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3405110056
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [20 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [1.6% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2444915001
##########
client/options.go:
##########
@@ -478,6 +480,12 @@ func setTLS(tls *global.TLSConfig) ReferenceOption {
}
}
+func setProtocols(protocols map[string]*global.ProtocolConfig) ReferenceOption {
Review Comment:
> add comment
我添加下注释
##########
client/options.go:
##########
@@ -937,6 +947,12 @@ func SetClientTLS(tls *global.TLSConfig) ClientOption {
}
}
+func SetProtocols(protocols map[string]*global.ProtocolConfig) ClientOption {
Review Comment:
> add comment
我添加下注释
--
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] optimize config [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3411831244
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034) **Quality Gate passed**
Issues
 [20 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3034&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3034&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_coverage&view=list)
 [1.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3034&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3034)
--
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] optimize config [dubbo-go]
Posted by "nanjiek (via GitHub)" <gi...@apache.org>.
nanjiek commented on PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#issuecomment-3422820564
resolve the conflicts
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2446534957
##########
protocol/grpc/server.go:
##########
@@ -150,22 +151,37 @@ func (s *Server) Start(url *common.URL) {
s.grpcServer = server
go func() {
- providerServices := config.GetProviderConfig().Services
-
- if len(providerServices) == 0 {
- panic("provider service map is null")
+ providerServices := s.getProviderServices(url)
+ if providerServices == nil {
+ logger.Error("no provider service found")
+ return
}
- // wait all exporter ready , then set proxy impl and grpc registerService
+ // wait all exporter ready, then set proxy impl and grpc registerService
waitGrpcExporter(providerServices)
registerService(providerServices, server)
reflection.Register(server)
-
- if err = server.Serve(lis); err != nil {
+ if err := server.Serve(lis); err != nil {
logger.Errorf("server serve failed with err: %v", err)
}
}()
}
+// getProviderServices retrieves provider services from config or URL attributes
+func (s *Server) getProviderServices(url *common.URL) map[string]*global.ServiceConfig {
Review Comment:
> why this func has a `(s *Server)` receiver? `s` seems unuse
I fix it
--
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] optimize config [dubbo-go]
Posted by "KamToHung (via GitHub)" <gi...@apache.org>.
KamToHung commented on code in PR #3034:
URL: https://github.com/apache/dubbo-go/pull/3034#discussion_r2443337501
##########
protocol/grpc/client.go:
##########
@@ -139,8 +139,12 @@ func NewClient(url *common.URL) (*Client, error) {
}
key := url.GetParam(constant.InterfaceKey, "")
- impl := config.GetConsumerServiceByInterfaceName(key)
- invoker := getInvoker(impl, conn)
+ //TODO: Temporary compatibility with old APIs, can be removed later
+ consumerService := config.GetConsumerServiceByInterfaceName(key)
+ if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+ consumerService = rpcService
Review Comment:
这里consumerService为any,不需要校验
--
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