This is an automated email from the ASF dual-hosted git repository.
alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/develop by this push:
new c591c8709 fix: reduce config warnings (#3018)
c591c8709 is described below
commit c591c8709db1cbcc2f578caba71b36397d0c4959
Author: CAICAII <[email protected]>
AuthorDate: Sat Sep 20 17:20:53 2025 +0800
fix: reduce config warnings (#3018)
* fix: add error return to health server methods and reduce config warnings
- Add error return type to HealthTripleServer methods (Resume,
SetServingStatus, Shutdown)
- Fix RPC method signature validation warnings
- Only warn about missing service config when services are actually
configured
- Improve compatibility with new server API without config files
* refactor: remove error returns from health server methods
* refactor: use precise type check for health server method validation
* style: fix formatting for health server method validation
---
common/rpc_service.go | 5 ++++-
server/server.go | 6 +++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/common/rpc_service.go b/common/rpc_service.go
index 6b27de6b5..84da0cd66 100644
--- a/common/rpc_service.go
+++ b/common/rpc_service.go
@@ -373,8 +373,11 @@ func suiteMethod(method reflect.Method) *MethodType {
// Reference is used to define service reference, and method with
prefix 'XXX' is generated by triple pb tool.
// SetGRPCServer is used for pb reflection.
+ // Health helper methods are not RPCs and should be ignored.
// They should not to be checked.
- if mname == "Reference" || mname == "SetGRPCServer" ||
strings.HasPrefix(mname, "XXX") {
+ if mname == "Reference" || mname == "SetGRPCServer" ||
strings.HasPrefix(mname, "XXX") ||
+ (method.Type.In(0).String() == "*health.HealthTripleServer" &&
+ (mname == "Resume" || mname == "SetServingStatus" ||
mname == "Shutdown")) {
return nil
}
diff --git a/server/server.go b/server/server.go
index 8d087e39e..29f23044e 100644
--- a/server/server.go
+++ b/server/server.go
@@ -139,7 +139,11 @@ func (s *Server) genSvcOpts(handler any, opts
...ServiceOption) (*ServiceOptions
)
logger.Infof("Injected options from provider.services
for %s", interfaceName)
} else {
- logger.Warnf("No matching service config found for
[%s]", interfaceName)
+ // Only warn if there are actually services configured
but none match
+ // This avoids unnecessary warnings when using new
server API without config files
+ if len(proCfg.Services) > 0 {
+ logger.Warnf("No matching service config found
for [%s]", interfaceName)
+ }
}
}
// options passed by users have higher priority