fantiq commented on code in PR #15639:
URL: https://github.com/apache/dubbo/pull/15639#discussion_r2297700383
##########
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java:
##########
@@ -72,6 +64,38 @@ public boolean hasValidMetadataCenter() {
applicationModel.getApplicationConfigManager().getMetadataConfigs());
}
+ @Override
+ protected boolean doMapping(MetadataReport metadataReport, URL url) {
+ boolean succeeded = false;
+ int currentRetryTimes = 1;
+ try {
+ do {
+ succeeded = super.doMapping(metadataReport, url);
+ if (succeeded) {
+ logger.info(
+ "[METADATA_REGISTER] [SERVICE_NAME_MAPPING]
Successfully registered interface application mapping for service "
+ + url.getServiceKey());
+ break;
+ } else {
+ int waitTime =
ThreadLocalRandom.current().nextInt(casRetryWaitTime);
+ logger.info("Failed to publish service name mapping to
metadata center by cas operation. "
+ + "Times: " + currentRetryTimes + ". "
+ + "Next retry delay: " + waitTime + ". "
+ + "Service Interface: " +
url.getServiceInterface() + ". ");
+ Thread.sleep(waitTime);
+ }
+ } while (currentRetryTimes++ <= casRetryTimes);
+ } catch (Exception e) {
+ logger.warn(
+ INTERNAL_ERROR,
+ "unknown error in registry module",
+ "",
+ "Failed registering mapping to remote." + metadataReport,
+ e);
+ }
Review Comment:
This is the logic of the implementation class, it overridden method `boolean
doMapping(MetadataReport metadataReport, URL url)`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]