This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 551f820a7edf386645b5e7cb820599202cab4b01
Merge: e069a7af9e c84b745bb1
Author: Albumen Kevin <[email protected]>
AuthorDate: Mon Aug 15 11:16:43 2022 +0800

    Merge branch 'apache-3.0' into apache-3.1
    
    # Conflicts:
    #       
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java

 .../dubbo/common/concurrent/AbortPolicy.java       | 32 +++++++++++
 .../common/concurrent/DiscardOldestPolicy.java     | 31 +++++++++++
 .../dubbo/common/concurrent/DiscardPolicy.java     | 31 +++++++++++
 .../dubbo/common/concurrent/RejectException.java   | 64 ++++++++++++++++++++++
 .../apache/dubbo/common/concurrent/Rejector.java   | 43 +++++++++++++++
 .../dubbo/common/json/impl/FastJsonImpl.java       |  4 +-
 .../threadpool/MemorySafeLinkedBlockingQueue.java  | 31 ++++++++++-
 .../MemorySafeLinkedBlockingQueueTest.java         | 11 ++++
 .../factory/annotation/ServiceBeanNameBuilder.java |  3 +-
 .../spring/reference/ReferenceBeanManager.java     | 23 +++++++-
 .../ServiceAnnotationPostProcessorTest.java        |  2 +-
 .../annotation/ServiceBeanNameBuilderTest.java     | 10 ++++
 .../zookeeper/ZookeeperDynamicConfiguration.java   |  2 +-
 .../dubbo/registry/support/AbstractRegistry.java   | 13 +++--
 ...bboEndpointAnnotationAutoConfigurationTest.java |  2 +-
 .../DubboEndpointAutoConfigurationTest.java        |  2 +-
 16 files changed, 288 insertions(+), 16 deletions(-)

diff --cc 
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java
index b9e83baf79,516a974945..c65e519720
--- 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java
+++ 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java
@@@ -82,10 -80,11 +83,12 @@@ public abstract class AbstractRegistry 
      private static final String URL_SPLIT = "\\s+";
      // Max times to retry to save properties to local cache file
      private static final int MAX_RETRY_TIMES_SAVE_PROPERTIES = 3;
+     // Default interval in millisecond for saving properties to local cache 
file
+     private static final long DEFAULT_INTERVAL_SAVE_PROPERTIES = 500L;
  
      // Log output
 -    protected final Logger logger = LoggerFactory.getLogger(getClass());
 +    protected final ErrorTypeAwareLogger logger = 
LoggerFactory.getErrorTypeAwareLogger(getClass());
 +
      // Local disk cache, where the special key value.registries records the 
list of registry centers, and the others are the list of notified service 
providers
      private final Properties properties = new Properties();
      // File cache timing writing
@@@ -276,13 -242,10 +279,13 @@@
                  savePropertiesRetryTimes.set(0);
                  return;
              } else {
-                 registryCacheExecutor.execute(() -> 
doSaveProperties(lastCacheChanged.incrementAndGet()));
+                 registryCacheExecutor.schedule(() -> 
doSaveProperties(lastCacheChanged.incrementAndGet()), 
DEFAULT_INTERVAL_SAVE_PROPERTIES, TimeUnit.MILLISECONDS);
              }
 +
              if (!(e instanceof OverlappingFileLockException)) {
 -                logger.warn("Failed to save registry cache file, will retry, 
cause: " + e.getMessage(), e);
 +                logger.warn("1-9", CAUSE_MULTI_DUBBO_USING_SAME_FILE,
 +                    "However, the retrying count limit is not exceeded. Dubbo 
will still try.",
 +                    "Failed to save registry cache file, will retry, cause: " 
+ e.getMessage(), e);
              }
          } finally {
              if (lockfile != null) {

Reply via email to