pkuwm commented on a change in pull request #642: Fix handleNewSession creating
ephemeral node with expired session
URL: https://github.com/apache/helix/pull/642#discussion_r361206249
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/ZkSessionMismatchedException.java
##########
@@ -0,0 +1,30 @@
+package org.apache.helix.manager.zk;
+
+import org.I0Itec.zkclient.exception.ZkException;
+import org.apache.zookeeper.KeeperException;
+
+
+/**
+ * Exception thrown when an action is taken by an expected zk session which
+ * does not match the actual zk session.
+ */
+public class ZkSessionMismatchedException extends ZkException {
+
+ private static final long serialVersionUID = 1L;
+
+ public ZkSessionMismatchedException() {
+ super();
+ }
+
+ public ZkSessionMismatchedException(KeeperException cause) {
Review comment:
One reason I added this: after retry, the session is expired and so cause
would be sessionExpiredException. I was initially planning to add the cause
into mismatched exception. ZkSessionMismatchedException is basically thrown to
avoid retry. So I thought wrapping session expired exception into
ZkSessionMismatchedException could give a clear cause. But in fact, I don't use
these 2 constructors now. I will remove them. If they are needed in the future,
they could added anytime.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]