[ 
https://issues.apache.org/jira/browse/SCB-846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16583261#comment-16583261
 ] 

ASF GitHub Bot commented on SCB-846:
------------------------------------

liubao68 closed pull request #872: [SCB-846] ConfigCenterClient log much in the 
pull mode
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/872
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
 
b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
index 3c0a19927..db5e5ac6d 100644
--- 
a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
+++ 
b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
@@ -375,14 +375,11 @@ public void refreshConfig(String configcenter, boolean 
wait) {
           if (rsp.statusCode() == HttpResponseStatus.OK.code()) {
             rsp.bodyHandler(buf -> {
               try {
-                String oldRevision = 
ParseConfigUtils.getInstance().getCurrentVersionInfo();
                 parseConfigUtils
                     
.refreshConfigItems(JsonUtils.OBJ_MAPPER.readValue(buf.toString(),
                         new TypeReference<LinkedHashMap<String, Map<String, 
String>>>() {
                         }));
                 EventManager.post(new ConnSuccEvent());
-                LOGGER.info("Updating remote config is done.,revision has 
changed from {} to {}", oldRevision,
-                    ParseConfigUtils.getInstance().getCurrentVersionInfo());
               } catch (IOException e) {
                 EventManager.post(new ConnFailEvent(
                     "config update result parse fail " + e.getMessage()));
diff --git 
a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ParseConfigUtils.java
 
b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ParseConfigUtils.java
index d86bd545d..b51e0d75f 100644
--- 
a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ParseConfigUtils.java
+++ 
b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ParseConfigUtils.java
@@ -74,14 +74,20 @@ public void initWithUpdateHandler(UpdateHandler 
updateHandler) {
   public void refreshConfigItems(Map<String, Map<String, Object>> remoteItems) 
{
     try {
       configLock.lock();
+      String oldRevision = currentVersionInfo;
       currentVersionInfo =
           remoteItems.getOrDefault("revision", new 
HashMap<>()).getOrDefault("version", "default").toString();
       //make sure the currentVersionInfo != ""
       currentVersionInfo = currentVersionInfo.equals("") ? "default" : 
currentVersionInfo;
-      remoteItems.remove("revision");//the key revision is not the config 
setting
+      //the key revision is not the config setting
+      boolean newVersion = (remoteItems.remove("revision") != null);
       multiDimensionItems.clear();
       multiDimensionItems.putAll(remoteItems);
       doRefreshItems();
+      if (newVersion) {
+        LOGGER.info("Updating remote config is done. revision has changed from 
{} to {}", oldRevision,
+            currentVersionInfo);
+      }
     } finally {
       configLock.unlock();
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [SCB-846] ConfigCenterClient log too much in the pull mode
> ----------------------------------------------------------
>
>                 Key: SCB-846
>                 URL: https://issues.apache.org/jira/browse/SCB-846
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Java-Chassis
>            Reporter: 何一乐
>            Assignee: 何一乐
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to