You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@seata.apache.org by "laywin (via GitHub)" <gi...@apache.org> on 2023/12/25 09:18:13 UTC

[PR] optimize: zk push empty protect [incubator-seata]

laywin opened a new pull request, #6206:
URL: https://github.com/apache/incubator-seata/pull/6206

   <!-- Please make sure you have read and understood the contributing guidelines -->
   
   - [ ] I have registered the PR [changes](../changes).
   
   ### Ⅰ. Describe what this PR did
   
   https://github.com/apache/incubator-seata/issues/6162
   
   ### Ⅱ. Does this pull request fix one issue?
   <!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
   
   https://github.com/apache/incubator-seata/issues/6162
   
   ### Ⅲ. Why don't you add test cases (unit test/integration test)? 
   
   
   ### Ⅳ. Describe how to verify it
   
   
   ### Ⅴ. Special notes for reviews
   
   


-- 
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: dev-unsubscribe@seata.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org


Re: [PR] optimize: zk push empty protect [incubator-seata]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #6206:
URL: https://github.com/apache/incubator-seata/pull/6206#issuecomment-1868891357

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/6206?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: `5 lines` in your changes are missing coverage. Please review.
   > Comparison is base [(`1a57f2d`)](https://app.codecov.io/gh/apache/incubator-seata/commit/1a57f2d71dc2260d30644fe68d6f8f21b39dbb85?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 49.03% compared to head [(`0a47eff`)](https://app.codecov.io/gh/apache/incubator-seata/pull/6206?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 48.99%.
   > Report is 1 commits behind head on 2.x.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/incubator-seata/pull/6206/graphs/tree.svg?width=650&height=150&src=pr&token=tbmHt2ZfxO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/incubator-seata/pull/6206?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@             Coverage Diff              @@
   ##                2.x    #6206      +/-   ##
   ============================================
   - Coverage     49.03%   48.99%   -0.04%     
   + Complexity     4786     4785       -1     
   ============================================
     Files           915      915              
     Lines         31896    31909      +13     
     Branches       3855     3856       +1     
   ============================================
   - Hits          15641    15635       -6     
   - Misses        14699    14717      +18     
   - Partials       1556     1557       +1     
   ```
   
   
   | [Files](https://app.codecov.io/gh/apache/incubator-seata/pull/6206?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...very/registry/zk/ZookeeperRegisterServiceImpl.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6206?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGlzY292ZXJ5L3NlYXRhLWRpc2NvdmVyeS16ay9zcmMvbWFpbi9qYXZhL2lvL3NlYXRhL2Rpc2NvdmVyeS9yZWdpc3RyeS96ay9ab29rZWVwZXJSZWdpc3RlclNlcnZpY2VJbXBsLmphdmE=) | `68.00% <75.00%> (+6.68%)` | :arrow_up: |
   
   ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/6206/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   </details>


-- 
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: dev-unsubscribe@seata.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org


Re: [PR] optimize: zk push empty protect [incubator-seata]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #6206:
URL: https://github.com/apache/incubator-seata/pull/6206#discussion_r1436031567


##########
discovery/seata-discovery-zk/src/main/java/io/seata/discovery/registry/zk/ZookeeperRegisterServiceImpl.java:
##########
@@ -310,6 +310,41 @@ private void refreshClusterAddressMap(String clusterName, List<String> instances
         CLUSTER_ADDRESS_MAP.put(clusterName, newAddressList);
     }
 
+    /**
+     *
+     * clear cluster's zk listener
+     *
+     * @param clusterName clusterName
+     */
+    private void clearClusterListener(String clusterName) {
+        List<IZkChildListener> listeners = LISTENER_SERVICE_MAP.get(clusterName);
+        for (IZkChildListener listener : listeners) {
+            try {
+                unsubscribe(clusterName, listener);
+            } catch (Exception e) {
+                LOGGER.warn("unsubscribe cluster {} failed", clusterName);
+            }
+        }
+    }
+
+    /***
+     *
+     * check whether it is current cluster
+     *
+     * @param clusterName cluserName
+     */
+    private boolean isCurrentCluster(String clusterName) {
+        String txServiceGroupName = ConfigurationFactory.getInstance()

Review Comment:
   如果使用的是seata-all,这个配置很有可能读不到,比如以下写法:
   If you are using seata-all, this configuration is likely to be unreadable, such as the following:
   `new GlobalTransactionScanner("test", "group_a", failureHandler);`
   



-- 
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: dev-unsubscribe@seata.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@seata.apache.org
For additional commands, e-mail: dev-help@seata.apache.org