You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "FinalT (via GitHub)" <gi...@apache.org> on 2023/06/02 03:14:12 UTC
[GitHub] [dubbo-go] FinalT commented on a diff in pull request #2311: ignore zk node already exist when store provider/consumer metadata
FinalT commented on code in PR #2311:
URL: https://github.com/apache/dubbo-go/pull/2311#discussion_r1213872289
##########
metadata/report/zookeeper/report.go:
##########
@@ -89,13 +89,23 @@ func (m *zookeeperMetadataReport) PublishAppMetadata(metadataIdentifier *identif
// StoreProviderMetadata stores the metadata.
func (m *zookeeperMetadataReport) StoreProviderMetadata(providerIdentifier *identifier.MetadataIdentifier, serviceDefinitions string) error {
k := m.rootDir + providerIdentifier.GetFilePathKey()
- return m.client.CreateWithValue(k, []byte(serviceDefinitions))
+ err := m.client.CreateWithValue(k, []byte(serviceDefinitions))
+ if err == zk.ErrNodeExists {
+ logger.Debugf("Try to store provider metadata failed. In most cases, it's not a problem. ")
+ return nil
+ }
+ return err
}
// StoreConsumerMetadata stores the metadata.
func (m *zookeeperMetadataReport) StoreConsumerMetadata(consumerMetadataIdentifier *identifier.MetadataIdentifier, serviceParameterString string) error {
k := m.rootDir + consumerMetadataIdentifier.GetFilePathKey()
- return m.client.CreateWithValue(k, []byte(serviceParameterString))
+ err := m.client.CreateWithValue(k, []byte(serviceParameterString))
+ if err == zk.ErrNodeExists {
Review Comment:
I think so too
--
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