Oops - forgot to uncomment line of code
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/79de36d5 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/79de36d5 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/79de36d5 Branch: refs/heads/persistent-watch Commit: 79de36d56ac945e35094f4c8c9d1471c289dfb49 Parents: b1e2b5c Author: randgalt <[email protected]> Authored: Thu Oct 5 16:15:18 2017 +0200 Committer: randgalt <[email protected]> Committed: Thu Oct 5 16:15:18 2017 +0200 ---------------------------------------------------------------------- .../src/main/java/org/apache/curator/RetryLoop.java | 6 ++++-- .../curator/framework/imps/ReconfigBuilderImpl.java | 2 +- .../recipes/locks/TestInterProcessMutexBase.java | 13 +++++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/79de36d5/curator-client/src/main/java/org/apache/curator/RetryLoop.java ---------------------------------------------------------------------- diff --git a/curator-client/src/main/java/org/apache/curator/RetryLoop.java b/curator-client/src/main/java/org/apache/curator/RetryLoop.java index 51df662..7b6bff2 100644 --- a/curator-client/src/main/java/org/apache/curator/RetryLoop.java +++ b/curator-client/src/main/java/org/apache/curator/RetryLoop.java @@ -18,6 +18,7 @@ */ package org.apache.curator; +import com.google.common.base.Throwables; import org.apache.curator.drivers.EventTrace; import org.apache.curator.drivers.TracerDriver; import org.apache.curator.utils.DebugUtils; @@ -147,9 +148,10 @@ public class RetryLoop */ public static boolean isRetryException(Throwable exception) { - if ( exception instanceof KeeperException ) + Throwable rootCause = Throwables.getRootCause(exception); + if ( rootCause instanceof KeeperException ) { - KeeperException keeperException = (KeeperException)exception; + KeeperException keeperException = (KeeperException)rootCause; return shouldRetry(keeperException.code().intValue()); } return false; http://git-wip-us.apache.org/repos/asf/curator/blob/79de36d5/curator-framework/src/main/java/org/apache/curator/framework/imps/ReconfigBuilderImpl.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/ReconfigBuilderImpl.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/ReconfigBuilderImpl.java index e70c11b..97be59a 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/ReconfigBuilderImpl.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/ReconfigBuilderImpl.java @@ -268,7 +268,7 @@ public class ReconfigBuilderImpl implements ReconfigBuilder, BackgroundOperation client.processBackgroundOperation(data, event); } }; - //client.getZooKeeper().reconfig(joining, leaving, newMembers, fromConfig, callback, backgrounding.getContext()); + client.getZooKeeper().reconfig(joining, leaving, newMembers, fromConfig, callback, backgrounding.getContext()); } catch ( Throwable e ) { http://git-wip-us.apache.org/repos/asf/curator/blob/79de36d5/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java index cf44daf..1662dd4 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java @@ -19,6 +19,7 @@ package org.apache.curator.framework.recipes.locks; +import com.google.common.base.Throwables; import com.google.common.collect.Lists; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; @@ -133,9 +134,17 @@ public abstract class TestInterProcessMutexBase extends BaseClassForTests { lock.release(); } - catch ( KeeperException.SessionExpiredException dummy ) + catch ( Exception e ) { - // happens sometimes with a few tests - ignore + //noinspection StatementWithEmptyBody + if ( Throwables.getRootCause(e) instanceof KeeperException.SessionExpiredException ) + { + // happens sometimes with a few tests - ignore + } + else + { + throw e; + } } } return result;
