ghostly72 commented on issue #13856:
URL: https://github.com/apache/dubbo/issues/13856#issuecomment-3732930473

   hi
   right now, in the pr i created for this, my code goes like (inside 
abstractregistry.java)
   ```
   if(localCacheEnabled && !isAvailable){
               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()+" : "+cached.size());
                   }
               }catch(Throwable t){
                   logger.warn(INTERNAL_ERROR,"failed to load local 
cache","","Failed to load chached registry data for "+url,t);
                   throw t;
               }
           }
   ```
   but this fails tests because i think `isAvailable()` returns false not only 
when the registry crashes, but also when:
   -the registry hasn’t connected yet (say during startup)
   -the client object is null (like in tests or mocks)
   -the registry was shut down gracefully


-- 
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]

Reply via email to