zrlw commented on code in PR #15873:
URL: https://github.com/apache/dubbo/pull/15873#discussion_r2633219571
##########
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java:
##########
@@ -456,6 +463,24 @@ public void subscribe(URL url, NotifyListener listener) {
Set<NotifyListener> listeners =
ConcurrentHashMapUtils.computeIfAbsent(subscribed, url, n ->
new ConcurrentHashSet<>());
listeners.add(listener);
+ if (localCacheEnabled) {
+ try {
+ List<URL> cached = getCacheUrls(url);
+ if (CollectionUtils.isNotEmpty(cached)) {
+ listener.notify(cached);
+ logger.info("Registry unavailable or not yet ready. Loaded
cached URLs for " + url.getServiceKey()
Review Comment:
why ```not-empty cached urls``` means ```Registry unavailable or not yet
ready``` ?
--
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]