You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Alanxtl (via GitHub)" <gi...@apache.org> on 2025/08/31 09:42:11 UTC
[PR] feat: add nacos LLM registry support [dubbo-go-pixiu]
Alanxtl opened a new pull request, #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746
the sample for the feat can refer to https://github.com/apache/dubbo-go-pixiu-samples/pull/92
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat: add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3240107795
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3506024167
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3448471362
@nanjiek
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3311216044
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl merged PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on code in PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#discussion_r2464775473
##########
pkg/adapter/llmregistry/registry/nacos/listener.go:
##########
@@ -0,0 +1,336 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+ "encoding/json"
+ "reflect"
+ "strconv"
+ "strings"
+ "sync"
+ "time"
+)
+
+import (
+ "dubbo.apache.org/dubbo-go/v3/remoting"
+
+ "github.com/creasty/defaults"
+
+ "github.com/hashicorp/go-uuid"
+
+ "github.com/nacos-group/nacos-sdk-go/clients/naming_client"
+ nacosModel "github.com/nacos-group/nacos-sdk-go/model"
+ "github.com/nacos-group/nacos-sdk-go/vo"
+)
+
+import (
+ "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/common"
+ "github.com/apache/dubbo-go-pixiu/pkg/common/constant"
+ "github.com/apache/dubbo-go-pixiu/pkg/logger"
+ "github.com/apache/dubbo-go-pixiu/pkg/model"
+)
+
+const (
+ // ServicePollingInterval How often to poll for the list of available services (to discover new ones).
+ ServicePollingInterval = 30 * time.Second
+)
+
+// listener monitors Nacos for service changes.
+type listener struct {
+ client naming_client.INamingClient
+ // Caches the last known instances for a given service. Key: ServiceName, Value: *sync.Map
+ instanceCache sync.Map
+ // Caches the set of services we are currently subscribed to. Key: ServiceName, Value: bool
+ subscribedServices sync.Map
+ regConf *model.Registry
+ adapterListener common.RegistryEventListener // The callback to notify the gateway core.
+
+ exit chan struct{}
+ wg sync.WaitGroup
+}
+
+// newNacosListener creates a new Nacos service listener.
+func newNacosListener(client naming_client.INamingClient, regConf *model.Registry, adapterListener common.RegistryEventListener) *listener {
+ return &listener{
+ client: client,
+ exit: make(chan struct{}),
+ regConf: regConf,
+ adapterListener: adapterListener,
+ }
+}
+
+// WatchAndHandle starts the background goroutine to watch for service changes.
+func (l *listener) WatchAndHandle() {
+ l.wg.Add(1)
+ go l.watchForServices()
+}
+
+// watchForServices periodically polls Nacos to discover new services to subscribe to.
+// The actual instance updates for subscribed services are push-based via the callback.
+func (l *listener) watchForServices() {
+ defer l.wg.Done()
+
+ ticker := time.NewTicker(ServicePollingInterval)
+ defer ticker.Stop()
+
+ // Perform an initial check immediately.
+ l.discoverAndSubscribe()
+
+ for {
+ select {
+ case <-l.exit:
+ logger.Info("Nacos listener is stopping...")
+ l.unsubscribeAll()
+ return
+ case <-ticker.C:
+ l.discoverAndSubscribe()
+ }
+ }
+}
+
+func (l *listener) discoverAndSubscribe() {
+ serviceList, err := l.client.GetAllServicesInfo(vo.GetAllServiceInfoParam{
+ GroupName: l.regConf.Group,
+ NameSpace: l.regConf.Namespace,
+ })
+ if err != nil {
+ logger.Warnf("Failed to get service list from Nacos: %v", err)
+ return
+ }
+
+ currentServices := make(map[string]struct{})
+ for _, serviceName := range serviceList.Doms {
+ currentServices[serviceName] = struct{}{}
+ // If we aren't already subscribed to this service, subscribe now.
+ if _, loaded := l.subscribedServices.LoadOrStore(serviceName, true); !loaded {
+ err := l.client.Subscribe(&vo.SubscribeParam{
+ ServiceName: serviceName,
+ GroupName: l.regConf.Group,
+ SubscribeCallback: l.serviceCallback,
+ })
+ if err != nil {
+ logger.Errorf("Failed to subscribe to Nacos service %s: %v", serviceName, err)
+ l.subscribedServices.Delete(serviceName) // Remove from map to retry next time.
+ } else {
+ logger.Infof("Successfully subscribed to Nacos service: %s", serviceName)
+ }
+ }
+ }
+
+ // Unsubscribe from services that no longer exist.
+ l.subscribedServices.Range(func(key, value any) bool {
+ serviceName := key.(string)
+ if _, exists := currentServices[serviceName]; !exists {
+ err := l.client.Unsubscribe(&vo.SubscribeParam{
+ ServiceName: serviceName,
+ GroupName: l.regConf.Group,
+ })
+ if err != nil {
+ logger.Errorf("Failed to unsubscribe from Nacos service %s: %v", serviceName, err)
+ } else {
+ logger.Infof("Successfully unsubscribed from Nacos service: %s", serviceName)
+ l.subscribedServices.Delete(serviceName)
+ l.instanceCache.Delete(serviceName)
+ }
+ }
+ return true
+ })
+}
+
+// serviceCallback is the function that Nacos SDK invokes when there's a change
+// in the instances of a subscribed service. This is the injected callback.
+func (l *listener) serviceCallback(services []nacosModel.SubscribeService, err error) {
+ if err != nil {
+ logger.Errorf("Nacos subscribe callback received an error: %v", err)
+ return
+ }
+ if len(services) == 0 {
+ logger.Warn("Nacos callback received an empty list of services, which might indicate all instances are offline.")
+ // The logic to handle removal of a service with zero instances
+ // is handled by the polling `discoverAndSubscribe` loop.
+ return
+ }
+
+ serviceName := services[0].ServiceName
+ logger.Debugf("Received callback for service: %s with %d instances", serviceName, len(services))
+
+ oldCache, _ := l.instanceCache.LoadOrStore(serviceName, &sync.Map{})
+ oldInstanceMap := oldCache.(*sync.Map)
+
+ newInstanceMap := &sync.Map{}
+ newEndpoints := make(map[string]*model.Endpoint)
+
+ // Process the new list from Nacos.
+ for i := range services {
+ // Also check for health
+ if !services[i].Enable || !services[i].Healthy {
+ continue
+ }
+ instance := generateInstance(services[i])
+ endpoint := generateEndpoint(instance)
+ if endpoint == nil {
+ continue
+ }
+ key := serviceName + constant.At + endpoint.ID
+ newInstanceMap.Store(key, instance)
+ newEndpoints[key] = endpoint
+ }
Review Comment:
这里每次循环都是以同样的方法设置key,并且后面需要使用这个key进行更新
如果key只设成endpoint.ID的话我怕有冲突,而且现在的设置key的方法也没什么坏处吧
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3450003363
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3450359424
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3315582130
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat: add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3240103552
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3315589163
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "Similarityoung (via GitHub)" <gi...@apache.org>.
Similarityoung commented on code in PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#discussion_r2452639327
##########
pkg/adapter/llmregistry/registry/nacos/listener.go:
##########
@@ -0,0 +1,336 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+ "encoding/json"
+ "reflect"
+ "strconv"
+ "strings"
+ "sync"
+ "time"
+)
+
+import (
+ "dubbo.apache.org/dubbo-go/v3/remoting"
+
+ "github.com/creasty/defaults"
+
+ "github.com/hashicorp/go-uuid"
+
+ "github.com/nacos-group/nacos-sdk-go/clients/naming_client"
+ nacosModel "github.com/nacos-group/nacos-sdk-go/model"
+ "github.com/nacos-group/nacos-sdk-go/vo"
+)
+
+import (
+ "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/common"
+ "github.com/apache/dubbo-go-pixiu/pkg/common/constant"
+ "github.com/apache/dubbo-go-pixiu/pkg/logger"
+ "github.com/apache/dubbo-go-pixiu/pkg/model"
+)
+
+const (
+ // ServicePollingInterval How often to poll for the list of available services (to discover new ones).
+ ServicePollingInterval = 30 * time.Second
+)
+
+// listener monitors Nacos for service changes.
+type listener struct {
+ client naming_client.INamingClient
+ // Caches the last known instances for a given service. Key: ServiceName, Value: *sync.Map
+ instanceCache sync.Map
+ // Caches the set of services we are currently subscribed to. Key: ServiceName, Value: bool
+ subscribedServices sync.Map
+ regConf *model.Registry
+ adapterListener common.RegistryEventListener // The callback to notify the gateway core.
+
+ exit chan struct{}
+ wg sync.WaitGroup
+}
+
+// newNacosListener creates a new Nacos service listener.
+func newNacosListener(client naming_client.INamingClient, regConf *model.Registry, adapterListener common.RegistryEventListener) *listener {
+ return &listener{
+ client: client,
+ exit: make(chan struct{}),
+ regConf: regConf,
+ adapterListener: adapterListener,
+ }
+}
+
+// WatchAndHandle starts the background goroutine to watch for service changes.
+func (l *listener) WatchAndHandle() {
+ l.wg.Add(1)
+ go l.watchForServices()
+}
+
+// watchForServices periodically polls Nacos to discover new services to subscribe to.
+// The actual instance updates for subscribed services are push-based via the callback.
+func (l *listener) watchForServices() {
+ defer l.wg.Done()
+
+ ticker := time.NewTicker(ServicePollingInterval)
+ defer ticker.Stop()
+
+ // Perform an initial check immediately.
+ l.discoverAndSubscribe()
+
+ for {
+ select {
+ case <-l.exit:
+ logger.Info("Nacos listener is stopping...")
+ l.unsubscribeAll()
+ return
+ case <-ticker.C:
+ l.discoverAndSubscribe()
+ }
+ }
+}
+
+func (l *listener) discoverAndSubscribe() {
+ serviceList, err := l.client.GetAllServicesInfo(vo.GetAllServiceInfoParam{
+ GroupName: l.regConf.Group,
+ NameSpace: l.regConf.Namespace,
+ })
+ if err != nil {
+ logger.Warnf("Failed to get service list from Nacos: %v", err)
+ return
+ }
+
+ currentServices := make(map[string]struct{})
+ for _, serviceName := range serviceList.Doms {
+ currentServices[serviceName] = struct{}{}
+ // If we aren't already subscribed to this service, subscribe now.
+ if _, loaded := l.subscribedServices.LoadOrStore(serviceName, true); !loaded {
+ err := l.client.Subscribe(&vo.SubscribeParam{
+ ServiceName: serviceName,
+ GroupName: l.regConf.Group,
+ SubscribeCallback: l.serviceCallback,
+ })
+ if err != nil {
+ logger.Errorf("Failed to subscribe to Nacos service %s: %v", serviceName, err)
+ l.subscribedServices.Delete(serviceName) // Remove from map to retry next time.
+ } else {
+ logger.Infof("Successfully subscribed to Nacos service: %s", serviceName)
+ }
+ }
+ }
+
+ // Unsubscribe from services that no longer exist.
+ l.subscribedServices.Range(func(key, value any) bool {
+ serviceName := key.(string)
+ if _, exists := currentServices[serviceName]; !exists {
+ err := l.client.Unsubscribe(&vo.SubscribeParam{
+ ServiceName: serviceName,
+ GroupName: l.regConf.Group,
+ })
+ if err != nil {
+ logger.Errorf("Failed to unsubscribe from Nacos service %s: %v", serviceName, err)
+ } else {
+ logger.Infof("Successfully unsubscribed from Nacos service: %s", serviceName)
+ l.subscribedServices.Delete(serviceName)
+ l.instanceCache.Delete(serviceName)
+ }
+ }
+ return true
+ })
+}
+
+// serviceCallback is the function that Nacos SDK invokes when there's a change
+// in the instances of a subscribed service. This is the injected callback.
+func (l *listener) serviceCallback(services []nacosModel.SubscribeService, err error) {
+ if err != nil {
+ logger.Errorf("Nacos subscribe callback received an error: %v", err)
+ return
+ }
+ if len(services) == 0 {
+ logger.Warn("Nacos callback received an empty list of services, which might indicate all instances are offline.")
+ // The logic to handle removal of a service with zero instances
+ // is handled by the polling `discoverAndSubscribe` loop.
+ return
+ }
+
+ serviceName := services[0].ServiceName
+ logger.Debugf("Received callback for service: %s with %d instances", serviceName, len(services))
+
+ oldCache, _ := l.instanceCache.LoadOrStore(serviceName, &sync.Map{})
+ oldInstanceMap := oldCache.(*sync.Map)
+
+ newInstanceMap := &sync.Map{}
+ newEndpoints := make(map[string]*model.Endpoint)
+
+ // Process the new list from Nacos.
+ for i := range services {
+ // Also check for health
+ if !services[i].Enable || !services[i].Healthy {
+ continue
+ }
+ instance := generateInstance(services[i])
+ endpoint := generateEndpoint(instance)
+ if endpoint == nil {
+ continue
+ }
+ key := serviceName + constant.At + endpoint.ID
+ newInstanceMap.Store(key, instance)
+ newEndpoints[key] = endpoint
+ }
Review Comment:
```go
oldCache, _ := l.instanceCache.LoadOrStore(serviceName, &sync.Map{})
```
oldCache already uses index of serviceName, so I think the key in next for loop may not need `serviceName`
just like
```go
key := endpoint.ID
```
##########
pkg/adapter/llmregistry/registry/nacos/registry.go:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+ "github.com/nacos-group/nacos-sdk-go/clients"
+ "github.com/nacos-group/nacos-sdk-go/clients/naming_client"
+ nacosConstant "github.com/nacos-group/nacos-sdk-go/common/constant"
+ "github.com/nacos-group/nacos-sdk-go/vo"
+)
+
+import (
+ "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/common"
+ "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/registry"
+ baseRegistry "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/registry/base"
+ "github.com/apache/dubbo-go-pixiu/pkg/common/constant"
+ "github.com/apache/dubbo-go-pixiu/pkg/common/util/stringutil"
+ "github.com/apache/dubbo-go-pixiu/pkg/model"
+)
+
+func init() {
+ registry.SetRegistry(constant.Nacos, newNacosRegistry)
+}
+
+type NacosRegistry struct {
+ *baseRegistry.BaseRegistry
+ nacosListener *listener
+ client naming_client.INamingClient
+}
+
+func (n *NacosRegistry) DoSubscribe() error {
+ go n.nacosListener.WatchAndHandle()
+ return nil
+}
+
+func (n *NacosRegistry) DoUnsubscribe() error {
+ n.nacosListener.Close()
+ return nil
+}
Review Comment:
maybe can add
```go
n.client.CloseClient()
```
to close nacos client
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "Similarityoung (via GitHub)" <gi...@apache.org>.
Similarityoung commented on code in PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#discussion_r2465048981
##########
pkg/adapter/llmregistry/registry/nacos/registry.go:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+ "github.com/nacos-group/nacos-sdk-go/clients"
+ "github.com/nacos-group/nacos-sdk-go/clients/naming_client"
+ nacosConstant "github.com/nacos-group/nacos-sdk-go/common/constant"
+ "github.com/nacos-group/nacos-sdk-go/vo"
+)
+
+import (
+ "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/common"
+ "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/registry"
+ baseRegistry "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/registry/base"
+ "github.com/apache/dubbo-go-pixiu/pkg/common/constant"
+ "github.com/apache/dubbo-go-pixiu/pkg/common/util/stringutil"
+ "github.com/apache/dubbo-go-pixiu/pkg/model"
+)
+
+func init() {
+ registry.SetRegistry(constant.Nacos, newNacosRegistry)
+}
+
+type NacosRegistry struct {
+ *baseRegistry.BaseRegistry
+ nacosListener *listener
+ client naming_client.INamingClient
+}
+
+func (n *NacosRegistry) DoSubscribe() error {
+ go n.nacosListener.WatchAndHandle()
+ return nil
+}
+
+func (n *NacosRegistry) DoUnsubscribe() error {
+ n.nacosListener.Close()
+ return nil
+}
Review Comment:
奇怪,我当时还特地试了下是有这个方法的,可能是因为我用的 nacos sdk 是 v2 版本的,不过既然有取消订阅的逻辑应该就可以了。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on code in PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#discussion_r2465002760
##########
pkg/adapter/llmregistry/registry/nacos/registry.go:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+ "github.com/nacos-group/nacos-sdk-go/clients"
+ "github.com/nacos-group/nacos-sdk-go/clients/naming_client"
+ nacosConstant "github.com/nacos-group/nacos-sdk-go/common/constant"
+ "github.com/nacos-group/nacos-sdk-go/vo"
+)
+
+import (
+ "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/common"
+ "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/registry"
+ baseRegistry "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/registry/base"
+ "github.com/apache/dubbo-go-pixiu/pkg/common/constant"
+ "github.com/apache/dubbo-go-pixiu/pkg/common/util/stringutil"
+ "github.com/apache/dubbo-go-pixiu/pkg/model"
+)
+
+func init() {
+ registry.SetRegistry(constant.Nacos, newNacosRegistry)
+}
+
+type NacosRegistry struct {
+ *baseRegistry.BaseRegistry
+ nacosListener *listener
+ client naming_client.INamingClient
+}
+
+func (n *NacosRegistry) DoSubscribe() error {
+ go n.nacosListener.WatchAndHandle()
+ return nil
+}
+
+func (n *NacosRegistry) DoUnsubscribe() error {
+ n.nacosListener.Close()
+ return nil
+}
Review Comment:
nacos client 没有 `CloseClient` 方法
此外,我在 `pkg/adapter/llmregistry/registry/nacos/listener.go:96` 监听了 `n.nacosListener.Close()` 的 close 信号,之后会调用 `l.unsubscribeAll()`, 这里面我会挨个做 `l.client.Unsubscribe()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3260831387
@CodiumAI-Agent /review
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3326256373
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3368668749
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "baerwang (via GitHub)" <gi...@apache.org>.
baerwang commented on code in PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#discussion_r2355302744
##########
pkg/adapter/llmregistry/registry/nacos/listener_test.go:
##########
@@ -0,0 +1,282 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+ "errors"
+ "sync"
+ "testing"
+ "time"
+)
+
+import (
+ "github.com/nacos-group/nacos-sdk-go/clients/naming_client"
+ nacosModel "github.com/nacos-group/nacos-sdk-go/model"
+ "github.com/nacos-group/nacos-sdk-go/vo"
+
+ "github.com/stretchr/testify/assert"
+)
+
+import (
+ "github.com/apache/dubbo-go-pixiu/pkg/model"
+)
+
+type mockNacosClient struct {
+ naming_client.INamingClient
+
+ mu sync.Mutex
+ servicesToReturn nacosModel.ServiceList
+ servicesToReturnErr error
+ subscribeCallback func(services []nacosModel.SubscribeService, err error)
+ subscribedServices map[string]bool
+ unsubscribedServices map[string]bool
Review Comment:
ditto
##########
pkg/adapter/llmregistry/registry/nacos/listener_test.go:
##########
@@ -0,0 +1,282 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+ "errors"
+ "sync"
+ "testing"
+ "time"
+)
+
+import (
+ "github.com/nacos-group/nacos-sdk-go/clients/naming_client"
+ nacosModel "github.com/nacos-group/nacos-sdk-go/model"
+ "github.com/nacos-group/nacos-sdk-go/vo"
+
+ "github.com/stretchr/testify/assert"
+)
+
+import (
+ "github.com/apache/dubbo-go-pixiu/pkg/model"
+)
+
+type mockNacosClient struct {
+ naming_client.INamingClient
+
+ mu sync.Mutex
+ servicesToReturn nacosModel.ServiceList
+ servicesToReturnErr error
+ subscribeCallback func(services []nacosModel.SubscribeService, err error)
+ subscribedServices map[string]bool
Review Comment:
use `map[string]struct{}`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3344909074
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "CodiumAI-Agent (via GitHub)" <gi...@apache.org>.
CodiumAI-Agent commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3261038065
**[Persistent review](https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3260837868)** updated to latest commit https://github.com/apache/dubbo-go-pixiu/commit/8caf86004a1b330307cb084fa853eb501f75ba0b
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "Similarityoung (via GitHub)" <gi...@apache.org>.
Similarityoung commented on code in PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#discussion_r2464804697
##########
pkg/adapter/llmregistry/registry/nacos/listener.go:
##########
@@ -0,0 +1,336 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+ "encoding/json"
+ "reflect"
+ "strconv"
+ "strings"
+ "sync"
+ "time"
+)
+
+import (
+ "dubbo.apache.org/dubbo-go/v3/remoting"
+
+ "github.com/creasty/defaults"
+
+ "github.com/hashicorp/go-uuid"
+
+ "github.com/nacos-group/nacos-sdk-go/clients/naming_client"
+ nacosModel "github.com/nacos-group/nacos-sdk-go/model"
+ "github.com/nacos-group/nacos-sdk-go/vo"
+)
+
+import (
+ "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/common"
+ "github.com/apache/dubbo-go-pixiu/pkg/common/constant"
+ "github.com/apache/dubbo-go-pixiu/pkg/logger"
+ "github.com/apache/dubbo-go-pixiu/pkg/model"
+)
+
+const (
+ // ServicePollingInterval How often to poll for the list of available services (to discover new ones).
+ ServicePollingInterval = 30 * time.Second
+)
+
+// listener monitors Nacos for service changes.
+type listener struct {
+ client naming_client.INamingClient
+ // Caches the last known instances for a given service. Key: ServiceName, Value: *sync.Map
+ instanceCache sync.Map
+ // Caches the set of services we are currently subscribed to. Key: ServiceName, Value: bool
+ subscribedServices sync.Map
+ regConf *model.Registry
+ adapterListener common.RegistryEventListener // The callback to notify the gateway core.
+
+ exit chan struct{}
+ wg sync.WaitGroup
+}
+
+// newNacosListener creates a new Nacos service listener.
+func newNacosListener(client naming_client.INamingClient, regConf *model.Registry, adapterListener common.RegistryEventListener) *listener {
+ return &listener{
+ client: client,
+ exit: make(chan struct{}),
+ regConf: regConf,
+ adapterListener: adapterListener,
+ }
+}
+
+// WatchAndHandle starts the background goroutine to watch for service changes.
+func (l *listener) WatchAndHandle() {
+ l.wg.Add(1)
+ go l.watchForServices()
+}
+
+// watchForServices periodically polls Nacos to discover new services to subscribe to.
+// The actual instance updates for subscribed services are push-based via the callback.
+func (l *listener) watchForServices() {
+ defer l.wg.Done()
+
+ ticker := time.NewTicker(ServicePollingInterval)
+ defer ticker.Stop()
+
+ // Perform an initial check immediately.
+ l.discoverAndSubscribe()
+
+ for {
+ select {
+ case <-l.exit:
+ logger.Info("Nacos listener is stopping...")
+ l.unsubscribeAll()
+ return
+ case <-ticker.C:
+ l.discoverAndSubscribe()
+ }
+ }
+}
+
+func (l *listener) discoverAndSubscribe() {
+ serviceList, err := l.client.GetAllServicesInfo(vo.GetAllServiceInfoParam{
+ GroupName: l.regConf.Group,
+ NameSpace: l.regConf.Namespace,
+ })
+ if err != nil {
+ logger.Warnf("Failed to get service list from Nacos: %v", err)
+ return
+ }
+
+ currentServices := make(map[string]struct{})
+ for _, serviceName := range serviceList.Doms {
+ currentServices[serviceName] = struct{}{}
+ // If we aren't already subscribed to this service, subscribe now.
+ if _, loaded := l.subscribedServices.LoadOrStore(serviceName, true); !loaded {
+ err := l.client.Subscribe(&vo.SubscribeParam{
+ ServiceName: serviceName,
+ GroupName: l.regConf.Group,
+ SubscribeCallback: l.serviceCallback,
+ })
+ if err != nil {
+ logger.Errorf("Failed to subscribe to Nacos service %s: %v", serviceName, err)
+ l.subscribedServices.Delete(serviceName) // Remove from map to retry next time.
+ } else {
+ logger.Infof("Successfully subscribed to Nacos service: %s", serviceName)
+ }
+ }
+ }
+
+ // Unsubscribe from services that no longer exist.
+ l.subscribedServices.Range(func(key, value any) bool {
+ serviceName := key.(string)
+ if _, exists := currentServices[serviceName]; !exists {
+ err := l.client.Unsubscribe(&vo.SubscribeParam{
+ ServiceName: serviceName,
+ GroupName: l.regConf.Group,
+ })
+ if err != nil {
+ logger.Errorf("Failed to unsubscribe from Nacos service %s: %v", serviceName, err)
+ } else {
+ logger.Infof("Successfully unsubscribed from Nacos service: %s", serviceName)
+ l.subscribedServices.Delete(serviceName)
+ l.instanceCache.Delete(serviceName)
+ }
+ }
+ return true
+ })
+}
+
+// serviceCallback is the function that Nacos SDK invokes when there's a change
+// in the instances of a subscribed service. This is the injected callback.
+func (l *listener) serviceCallback(services []nacosModel.SubscribeService, err error) {
+ if err != nil {
+ logger.Errorf("Nacos subscribe callback received an error: %v", err)
+ return
+ }
+ if len(services) == 0 {
+ logger.Warn("Nacos callback received an empty list of services, which might indicate all instances are offline.")
+ // The logic to handle removal of a service with zero instances
+ // is handled by the polling `discoverAndSubscribe` loop.
+ return
+ }
+
+ serviceName := services[0].ServiceName
+ logger.Debugf("Received callback for service: %s with %d instances", serviceName, len(services))
+
+ oldCache, _ := l.instanceCache.LoadOrStore(serviceName, &sync.Map{})
+ oldInstanceMap := oldCache.(*sync.Map)
+
+ newInstanceMap := &sync.Map{}
+ newEndpoints := make(map[string]*model.Endpoint)
+
+ // Process the new list from Nacos.
+ for i := range services {
+ // Also check for health
+ if !services[i].Enable || !services[i].Healthy {
+ continue
+ }
+ instance := generateInstance(services[i])
+ endpoint := generateEndpoint(instance)
+ if endpoint == nil {
+ continue
+ }
+ key := serviceName + constant.At + endpoint.ID
+ newInstanceMap.Store(key, instance)
+ newEndpoints[key] = endpoint
+ }
Review 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] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3315590144
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat: add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3240113315
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat: add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3240117048
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3326313456
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on code in PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#discussion_r2371462553
##########
pkg/adapter/llmregistry/registry/nacos/listener.go:
##########
@@ -19,6 +19,7 @@ package nacos
import (
"encoding/json"
+ "github.com/hashicorp/go-uuid"
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3326275098
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3326311170
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#discussion_r2366145980
##########
pkg/adapter/llmregistry/registry/nacos/listener.go:
##########
@@ -19,6 +19,7 @@ package nacos
import (
"encoding/json"
+ "github.com/hashicorp/go-uuid"
Review Comment:
modify 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] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3365373690
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3365270626
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [6 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat: add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3240003372
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.6% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat: add nacos LLM registry support [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3239972305
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=746&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_coverage&view=list)
 [8.6% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=746&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=746)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3261033268
···markdown
Thanks for adding Nacos LLM registry support! The implementation is solid, but I have a few suggestions:
1. Add unit tests for `nacosLLMRegistry` to cover `Register`, `UnRegister`, etc.
2. Rename `nacosLLMRegistry` to `NacosLLMRegistry` for consistency.
3. Update `README.md` with Nacos LLM usage instructions.
4. Address SonarQube's 8 issues and 8.5% duplication rate.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "CodiumAI-Agent (via GitHub)" <gi...@apache.org>.
CodiumAI-Agent commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3260837868
## PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
<table>
<tr><td>⏱️ <strong>Estimated effort to review</strong>: 4 🔵🔵🔵🔵⚪</td></tr>
<tr><td>🧪 <strong>PR contains tests</strong></td></tr>
<tr><td>🔒 <strong>Security concerns</strong><br><br>
<strong>Sensitive information handling:</strong><br> The Nacos listener parses 'llm-meta.api_keys' from instance metadata and stores them in Endpoint.LLMMeta. Ensure logs never print raw keys (current logs include endpoint.Name and Address, not keys). Confirm that the API keys are not exposed via diagnostics or metrics, and consider masking if any logging of LLMMeta occurs elsewhere.</td></tr>
<tr><td>⚡ <strong>Recommended focus areas for review</strong><br><br>
<details><summary><a href='https://github.com/apache/dubbo-go-pixiu/pull/746/files#diff-7c8965a7c48e0fa60edbdd154643d6c85d9ff72ea43d536741a82f0bdd0a9a63R167-R213'><strong>Possible Issue</strong></a>
The serviceCallback builds endpoint keys as serviceName + '@' + endpoint.ID, but OnRemoveEndpoint uses only endpoint.ID for deletion. Ensure cluster manager DeleteEndpoint expects ID only; otherwise, removals might not target the correct instance when IDs are not globally unique across services.
</summary>
```go
serviceName := services[0].ServiceName
logger.Debugf("Received callback for service: %s with %d instances", serviceName, len(services))
oldCache, _ := l.instanceCache.LoadOrStore(serviceName, &sync.Map{})
oldInstanceMap := oldCache.(*sync.Map)
newInstanceMap := &sync.Map{}
newEndpoints := make(map[string]*model.Endpoint)
// Process the new list from Nacos.
for i := range services {
// Also check for health
if !services[i].Enable || !services[i].Healthy {
continue
}
instance := generateInstance(services[i])
endpoint := generateEndpoint(instance)
if endpoint == nil {
continue
}
key := serviceName + constant.At + endpoint.ID
newInstanceMap.Store(key, instance)
newEndpoints[key] = endpoint
}
// Check for added or updated instances.
for key, endpoint := range newEndpoints {
if oldRaw, ok := oldInstanceMap.Load(key); ok {
oldInstance := oldRaw.(nacosModel.Instance)
newInstance, _ := newInstanceMap.Load(key)
if !reflect.DeepEqual(oldInstance, newInstance) {
l.handle(endpoint, remoting.EventTypeUpdate)
}
} else {
l.handle(endpoint, remoting.EventTypeAdd)
}
}
// Check for removed instances.
oldInstanceMap.Range(func(key, value any) bool {
instanceKey := key.(string)
if _, ok := newEndpoints[instanceKey]; !ok {
instance := value.(nacosModel.Instance)
endpoint := generateEndpoint(instance)
l.handle(endpoint, remoting.EventTypeDel)
}
```
</details>
<details><summary><a href='https://github.com/apache/dubbo-go-pixiu/pull/746/files#diff-9c9f5ad8f7a29664c69f45eb02ae214541b391eae414816ac79d2dbc6a2ae72aR56-R89'><strong>Backward Compatibility</strong></a>
newCountBasedRetry now accepts string/float64 for 'times'. Verify existing configs (mapstructure/yaml) still pass integers as before and that zero/negative handling matches previous semantics. Also confirm tests cover float string and boundary values.
</summary>
```go
func newCountBasedRetry(config map[string]any) (retry.RetryPolicy, error) {
timesValue, exists := config[retryTimesKey]
if !exists {
timesValue = defaultRetryTimes
}
var times int
switch v := timesValue.(type) {
case int:
times = v
case float64:
if v != float64(int(v)) {
return nil, fmt.Errorf("invalid float value for '%s', must be a whole number, but got %f", retryTimesKey, v)
}
times = int(v)
case string:
parsedTimes, err := strconv.Atoi(v)
if err != nil {
return nil, fmt.Errorf("could not parse string value for '%s': %w", retryTimesKey, err)
}
times = parsedTimes
default:
return nil, fmt.Errorf("invalid type for '%s', expected a number or a numeric string, but got %T", retryTimesKey, timesValue)
}
// must be non-negative
if times < 0 {
return nil, fmt.Errorf("value for '%s' cannot be negative, but got %d", retryTimesKey, times)
}
// Total attempts = 1 initial try plus number of retries.
return &CountBasedRetry{MaxAttempts: uint(times) + 1}, nil
}
```
</details>
<details><summary><a href='https://github.com/apache/dubbo-go-pixiu/pull/746/files#diff-c1f6bf093ce56a0a962e4b4fc42c728bc9a7d37fc3d57e02ad615138002b698bR256-R309'><strong>API Change</strong></a>
AssembleClusterEndpoints renamed and refactored to assembleClusterEndpoints plus exported helper AssembleLLMProviderDomains. Validate all external/internal callers updated accordingly and no packages rely on the old exported name.
</summary>
```go
func (s *ClusterStore) AddCluster(c *model.ClusterConfig) {
if c.Name == "" {
c.Name = fmt.Sprintf("cluster-%d", clusterIndex)
atomic.AddInt32(&clusterIndex, 1)
}
s.assembleClusterEndpoints(c)
s.Config = append(s.Config, c)
s.clustersMap[c.Name] = cluster.NewCluster(c)
c.CreateConsistentHash()
}
// assembleClusterEndpoints assembles the cluster endpoints
// by formatting the ID, name and domains for each endpoint
// If endpoint.LLMMeta is not nil, the assimilation of name and domain is based on
// the LLM provider denoted in the endpoint LLMMeta.
func (s *ClusterStore) assembleClusterEndpoints(c *model.ClusterConfig) {
if c == nil {
return
}
for i, endpoint := range c.Endpoints {
// If the endpoint ID is not set, set it to the index + 1
if endpoint.ID == "" {
endpoint.ID = strconv.Itoa(i + 1)
}
// If the endpoint has no name, set a default name
if endpoint.Name == "" && endpoint.LLMMeta != nil {
endpoint.Name = fmt.Sprintf("endpoint-%d#%s", i+1, endpoint.LLMMeta.Provider)
} else if endpoint.Name == "" && endpoint.LLMMeta == nil {
endpoint.Name = fmt.Sprintf("endpoint-%d", i+1)
}
c.Endpoints[i] = AssembleLLMProviderDomains(endpoint)
}
}
func AssembleLLMProviderDomains(endpoint *model.Endpoint) *model.Endpoint {
// If the endpoint address and domain are not set, set them based on the LLM provider.
// If the endpoint address or domain is set, do not modify them.
if endpoint.LLMMeta != nil && endpoint.Address.Address == constant.PprofDefaultAddress && endpoint.Address.Domains == nil {
domain, err := model.GetLLMProviderDomains(endpoint.LLMMeta.Provider)
if err != nil {
logger.Errorf("failed to get llm provider domains, err: %v", err)
return endpoint
}
endpoint.Address.Domains = []string{domain.BaseUrl}
}
return endpoint
}
```
</details>
</td></tr>
</table>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3261327795
@code-rabbit review
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] feat(ai-gateway): add nacos LLM registry support [dubbo-go-pixiu]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#issuecomment-3326264970
## [Codecov](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746?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 `50.00000%` with `5 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 15.95%. Comparing base ([`26606a8`](https://app.codecov.io/gh/apache/dubbo-go-pixiu/commit/26606a8317ac79fb8ce826138a34908b62beae1c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`0e12861`](https://app.codecov.io/gh/apache/dubbo-go-pixiu/commit/0e128614fc1181c5c0e404e2600b14aa5d48e84f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 67 commits behind head on develop.
| [Files with missing lines](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [pkg/model/llm.go](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746?src=pr&el=tree&filepath=pkg%2Fmodel%2Fllm.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL21vZGVsL2xsbS5nbw==) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [pkg/server/adapter\_manager.go](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746?src=pr&el=tree&filepath=pkg%2Fserver%2Fadapter_manager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL3NlcnZlci9hZGFwdGVyX21hbmFnZXIuZ28=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [pkg/server/cluster\_manager.go](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746?src=pr&el=tree&filepath=pkg%2Fserver%2Fcluster_manager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL3NlcnZlci9jbHVzdGVyX21hbmFnZXIuZ28=) | 50.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (26606a8) and HEAD (0e12861). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (26606a8) | HEAD (0e12861) |
>|------|------|------|
>||1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## develop #746 +/- ##
============================================
- Coverage 54.67% 15.95% -38.72%
============================================
Files 671 221 -450
Lines 78658 16350 -62308
============================================
- Hits 43006 2609 -40397
+ Misses 31981 13503 -18478
+ Partials 3671 238 -3433
```
| [Flag](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `15.95% <50.00%> (?)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/746?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.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</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