You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2021/05/04 02:55:56 UTC

[GitHub] [helix] rabashizade commented on a change in pull request #1718: Clarify error for ZkSessionMismatchedException in ZkAsyncCallbacks

rabashizade commented on a change in pull request #1718:
URL: https://github.com/apache/helix/pull/1718#discussion_r625481698



##########
File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/callback/ZkAsyncCallbacks.java
##########
@@ -289,7 +290,11 @@ protected boolean needRetry(int rc) {
           return false;
         }
       } catch (ClassCastException | NullPointerException ex) {
-        LOG.error("Failed to handle unknown return code {}. Skip retrying.", rc, ex);
+        if(rc == ZK_SESSION_MISMATCHED_CODE) {
+          LOG.error("Actual session ID doesn't match with expected session ID. Skip retrying.");
+        } else {
+          LOG.error("Failed to handle unknown return code {}. Skip retrying.", rc, ex);
+        }

Review comment:
       Based on the different exception classes that extend `ZkException` in the package `org.apache.helix.zookeeper.zkclient.exception`, only `ZkSessionMismatchedException` and `ZkInterruptedException` don't already have corresponding codes in `KeeperException.Code`, and `ZkInterruptedException` seems to be only adding thread interruption capability to `ZkException`. So it seems to me that `ZkSessionMismatchedException` is the only exception type in Helix project without a corresponding `KeeperException.Code`. Do we expect more error codes to be added in the future? Because otherwise, it seems to me that adding a new class for this one error code is a bit of an overkill. But if you think this is the right approach, I will add the class.




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org