You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/26 13:37:36 UTC

[GitHub] [dubbo] AlbumenJ opened a new pull request, #11036: Fix zookeeper cas failed when create

AlbumenJ opened a new pull request, #11036:
URL: https://github.com/apache/dubbo/pull/11036

   ## What is the purpose of the change
   
   Fix service name mapping data being override when two process are creating persistent node in zookeeper at the same time.
   
   ## Brief changelog
   
   
   ## Verifying this change
   
   
   <!-- Follow this checklist to help us incorporate your contribution quickly and easily: -->
   
   ## Checklist
   - [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
   - [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
   - [ ] Add some description to [dubbo-website](https://github.com/apache/dubbo-website) project if you are requesting to add a feature.
   - [ ] GitHub Actions works fine on your own branch.
   - [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] sonarcloud[bot] commented on pull request #11036: Fix zookeeper cas failed when create

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11036:
URL: https://github.com/apache/dubbo/pull/11036#issuecomment-1328263428

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=11036)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=11036&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=11036&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=11036&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=CODE_SMELL)
   
   [![35.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '35.9%')](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_coverage&view=list) [35.9% Coverage](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_coverage&view=list)  
   [![18.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '18.3%')](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_duplicated_lines_density&view=list) [18.3% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] sonarcloud[bot] commented on pull request #11036: Fix zookeeper cas failed when create

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11036:
URL: https://github.com/apache/dubbo/pull/11036#issuecomment-1328161184

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=11036)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=11036&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=11036&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=11036&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=CODE_SMELL) [3 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=CODE_SMELL)
   
   [![36.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '36.5%')](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_coverage&view=list) [36.5% Coverage](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_coverage&view=list)  
   [![18.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '18.7%')](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_duplicated_lines_density&view=list) [18.7% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #11036: Fix zookeeper cas failed when create

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #11036:
URL: https://github.com/apache/dubbo/pull/11036#discussion_r1033091524


##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/zookeeper/ZookeeperClient.java:
##########
@@ -33,7 +33,7 @@ public interface ZookeeperClient {
      * @param path path to ZNode
      * @param ephemeral specify create mode of ZNode creation. true - EPHEMERAL, false - PERSISTENT.
      */
-    void create(String path, boolean ephemeral);
+    void create(String path, boolean ephemeral, boolean faultTolarance);

Review Comment:
   done



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] CrazyHZM commented on a diff in pull request #11036: Fix zookeeper cas failed when create

Posted by GitBox <gi...@apache.org>.
CrazyHZM commented on code in PR #11036:
URL: https://github.com/apache/dubbo/pull/11036#discussion_r1033082143


##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/zookeeper/ZookeeperClient.java:
##########
@@ -33,7 +33,7 @@ public interface ZookeeperClient {
      * @param path path to ZNode
      * @param ephemeral specify create mode of ZNode creation. true - EPHEMERAL, false - PERSISTENT.
      */
-    void create(String path, boolean ephemeral);
+    void create(String path, boolean ephemeral, boolean faultTolarance);

Review Comment:
   Description of the addition of the `faultTolarance` parameter, other LGTM



##########
dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java:
##########
@@ -119,60 +119,79 @@ public List<ACL> getAclForPath(String path) {
     }
 
     @Override
-    public void createPersistent(String path) {
+    public void createPersistent(String path, boolean faultTolerant) {
         try {
             client.create().forPath(path);
         } catch (NodeExistsException e) {
-            logger.warn(REGISTRY_ZOOKEEPER_EXCEPTION, "", "", "ZNode " + path + " already exists.", e);
+            if (!faultTolerant) {
+                logger.warn(REGISTRY_ZOOKEEPER_EXCEPTION, "", "", "ZNode " + path + " already exists.", e);
+                throw new IllegalStateException(e.getMessage(), e);
+            }
         } catch (Exception e) {
             throw new IllegalStateException(e.getMessage(), e);
         }
     }
 
     @Override
-    public void createEphemeral(String path) {
+    public void createEphemeral(String path, boolean faultTolerant) {
         try {
             client.create().withMode(CreateMode.EPHEMERAL).forPath(path);
         } catch (NodeExistsException e) {
-            logger.warn(REGISTRY_ZOOKEEPER_EXCEPTION, "", "", "ZNode " + path + " already exists, since we will only try to recreate a node on a session expiration" +
-                ", this duplication might be caused by a delete delay from the zk server, which means the old expired session" +
-                " may still holds this ZNode and the server just hasn't got time to do the deletion. In this case, " +
-                "we can just try to delete and create again.", e);
-            deletePath(path);
-            createEphemeral(path);
+            if (faultTolerant) {
+                logger.info("ZNode " + path + " already exists, since we will only try to recreate a node on a session expiration" +
+                    ", this duplication might be caused by a delete delay from the zk server, which means the old expired session" +
+                    " may still holds this ZNode and the server just hasn't got time to do the deletion. In this case, " +
+                    "we can just try to delete and create again.");
+                deletePath(path);
+                createEphemeral(path, true);

Review Comment:
   There is no `createOrUpdate` function here, so why do you need to recreate it?



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] sonarcloud[bot] commented on pull request #11036: Fix zookeeper cas failed when create

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11036:
URL: https://github.com/apache/dubbo/pull/11036#issuecomment-1328510459

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=11036)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=11036&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=11036&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=11036&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=11036&resolved=false&types=CODE_SMELL)
   
   [![35.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '35.9%')](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_coverage&view=list) [35.9% Coverage](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_coverage&view=list)  
   [![18.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '18.3%')](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_duplicated_lines_density&view=list) [18.3% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=11036&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #11036: Fix zookeeper cas failed when create

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #11036:
URL: https://github.com/apache/dubbo/pull/11036#discussion_r1032789516


##########
dubbo-metadata/dubbo-metadata-report-zookeeper/src/main/java/org/apache/dubbo/metadata/store/zookeeper/ZookeeperMetadataReport.java:
##########
@@ -198,7 +198,7 @@ public boolean registerServiceAppMapping(String key, String group, String conten
                 throw new IllegalArgumentException("zookeeper publishConfigCas requires stat type ticket");
             }
             String pathKey = buildPathKey(group, key);
-            zkClient.createOrUpdate(pathKey, content, false, ticket == null ? 0 : ((Stat) ticket).getVersion());
+            zkClient.createOrUpdate(pathKey, content, false, ticket == null ? 0 : ((Stat) ticket).getVersion(), false);

Review Comment:
   If node is already exist when creating, will throw exception here.



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ merged pull request #11036: Fix zookeeper cas failed when create

Posted by GitBox <gi...@apache.org>.
AlbumenJ merged PR #11036:
URL: https://github.com/apache/dubbo/pull/11036


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] codecov-commenter commented on pull request #11036: Fix zookeeper cas failed when create

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #11036:
URL: https://github.com/apache/dubbo/pull/11036#issuecomment-1328161461

   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/11036?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11036](https://codecov.io/gh/apache/dubbo/pull/11036?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a0b9df3) into [3.1](https://codecov.io/gh/apache/dubbo/commit/0e95ac4e39704cc75d5f3a38e168524a30cf8902?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0e95ac4) will **decrease** coverage by `1.07%`.
   > The diff coverage is `41.90%`.
   
   > :exclamation: Current head a0b9df3 differs from pull request most recent head 1597945. Consider uploading reports for the commit 1597945 to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.1   #11036      +/-   ##
   ============================================
   - Coverage     65.60%   64.53%   -1.08%     
   + Complexity       20       14       -6     
   ============================================
     Files          1418     1418              
     Lines         58874    58929      +55     
     Branches       8665     8645      -20     
   ============================================
   - Hits          38624    38029     -595     
   - Misses        16242    16859     +617     
   - Partials       4008     4041      +33     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/11036?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...pport/zookeeper/ZookeeperDynamicConfiguration.java](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnY2VudGVyL2R1YmJvLWNvbmZpZ2NlbnRlci16b29rZWVwZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZ2NlbnRlci9zdXBwb3J0L3pvb2tlZXBlci9ab29rZWVwZXJEeW5hbWljQ29uZmlndXJhdGlvbi5qYXZh) | `58.33% <0.00%> (ø)` | |
   | [...ting/zookeeper/curator/CuratorZookeeperClient.java](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3Rpbmctem9va2VlcGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy96b29rZWVwZXIvY3VyYXRvci9DdXJhdG9yWm9va2VlcGVyQ2xpZW50LmphdmE=) | `13.53% <0.00%> (-57.84%)` | :arrow_down: |
   | [...ng/zookeeper/curator5/Curator5ZookeeperClient.java](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3Rpbmctem9va2VlcGVyLWN1cmF0b3I1L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy96b29rZWVwZXIvY3VyYXRvcjUvQ3VyYXRvcjVab29rZWVwZXJDbGllbnQuamF2YQ==) | `75.40% <66.66%> (+4.18%)` | :arrow_up: |
   | [...adata/store/zookeeper/ZookeeperMetadataReport.java](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tbWV0YWRhdGEvZHViYm8tbWV0YWRhdGEtcmVwb3J0LXpvb2tlZXBlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vbWV0YWRhdGEvc3RvcmUvem9va2VlcGVyL1pvb2tlZXBlck1ldGFkYXRhUmVwb3J0LmphdmE=) | `73.40% <100.00%> (ø)` | |
   | [...he/dubbo/registry/zookeeper/ZookeeperRegistry.java](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktem9va2VlcGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS96b29rZWVwZXIvWm9va2VlcGVyUmVnaXN0cnkuamF2YQ==) | `61.57% <100.00%> (+0.52%)` | :arrow_up: |
   | [...bo/remoting/zookeeper/AbstractZookeeperClient.java](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy96b29rZWVwZXIvQWJzdHJhY3Rab29rZWVwZXJDbGllbnQuamF2YQ==) | `85.05% <100.00%> (-0.34%)` | :arrow_down: |
   | [...luster/router/script/ScriptStateRouterFactory.java](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY2x1c3Rlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL2NsdXN0ZXIvcm91dGVyL3NjcmlwdC9TY3JpcHRTdGF0ZVJvdXRlckZhY3RvcnkuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...he/dubbo/test/common/impl/GreetingServiceImpl.java](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tdGVzdC9kdWJiby10ZXN0LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vdGVzdC9jb21tb24vaW1wbC9HcmVldGluZ1NlcnZpY2VJbXBsLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...zookeeper/curator/CuratorZookeeperTransporter.java](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3Rpbmctem9va2VlcGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy96b29rZWVwZXIvY3VyYXRvci9DdXJhdG9yWm9va2VlcGVyVHJhbnNwb3J0ZXIuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../apache/dubbo/test/spring/SpringXmlConfigTest.java](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tdGVzdC9kdWJiby10ZXN0LXNwcmluZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vdGVzdC9zcHJpbmcvU3ByaW5nWG1sQ29uZmlnVGVzdC5qYXZh) | `0.00% <0.00%> (-96.16%)` | :arrow_down: |
   | ... and [109 more](https://codecov.io/gh/apache/dubbo/pull/11036/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on pull request #11036: Fix zookeeper cas failed when create

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on PR #11036:
URL: https://github.com/apache/dubbo/pull/11036#issuecomment-1328252497

   Duplication could not be fixed due to cruator build compatibility.


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #11036: Fix zookeeper cas failed when create

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #11036:
URL: https://github.com/apache/dubbo/pull/11036#discussion_r1033089660


##########
dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java:
##########
@@ -119,60 +119,79 @@ public List<ACL> getAclForPath(String path) {
     }
 
     @Override
-    public void createPersistent(String path) {
+    public void createPersistent(String path, boolean faultTolerant) {
         try {
             client.create().forPath(path);
         } catch (NodeExistsException e) {
-            logger.warn(REGISTRY_ZOOKEEPER_EXCEPTION, "", "", "ZNode " + path + " already exists.", e);
+            if (!faultTolerant) {
+                logger.warn(REGISTRY_ZOOKEEPER_EXCEPTION, "", "", "ZNode " + path + " already exists.", e);
+                throw new IllegalStateException(e.getMessage(), e);
+            }
         } catch (Exception e) {
             throw new IllegalStateException(e.getMessage(), e);
         }
     }
 
     @Override
-    public void createEphemeral(String path) {
+    public void createEphemeral(String path, boolean faultTolerant) {
         try {
             client.create().withMode(CreateMode.EPHEMERAL).forPath(path);
         } catch (NodeExistsException e) {
-            logger.warn(REGISTRY_ZOOKEEPER_EXCEPTION, "", "", "ZNode " + path + " already exists, since we will only try to recreate a node on a session expiration" +
-                ", this duplication might be caused by a delete delay from the zk server, which means the old expired session" +
-                " may still holds this ZNode and the server just hasn't got time to do the deletion. In this case, " +
-                "we can just try to delete and create again.", e);
-            deletePath(path);
-            createEphemeral(path);
+            if (faultTolerant) {
+                logger.info("ZNode " + path + " already exists, since we will only try to recreate a node on a session expiration" +
+                    ", this duplication might be caused by a delete delay from the zk server, which means the old expired session" +
+                    " may still holds this ZNode and the server just hasn't got time to do the deletion. In this case, " +
+                    "we can just try to delete and create again.");
+                deletePath(path);
+                createEphemeral(path, true);

Review Comment:
   For ephemeral nodes, it needs to be recreated by the current process. Otherwise, the node may be deleted due to the lifetime of other processes.



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org