Curator has a big problem with thread interrupted states getting cleared. There are several issues on this (CURATOR-208, CURATOR-205, CURATOR-228, CURATOR-109
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/23554479 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/23554479 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/23554479 Branch: refs/heads/CURATOR-248 Commit: 23554479597d654fa8318cdc579fc3cc29bc2c54 Parents: 30bd7b6 Author: randgalt <randg...@apache.org> Authored: Sat Aug 22 20:10:34 2015 -0500 Committer: randgalt <randg...@apache.org> Committed: Sat Aug 22 20:10:34 2015 -0500 ---------------------------------------------------------------------- .../org/apache/curator/framework/state/ConnectionStateManager.java | 2 +- .../java/org/apache/curator/framework/imps/TestFrameworkEdges.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/23554479/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java b/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java index 406099d..44d511b 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java @@ -248,7 +248,7 @@ public class ConnectionStateManager implements Closeable { try { - while ( !Thread.currentThread().isInterrupted() ) + while ( !Thread.currentThread().isInterrupted() && (state.get() == State.STARTED) ) { int pollMaxMs = (sessionTimeoutMs * 2) / 3; // 2/3 of session timeout final ConnectionState newState = eventQueue.poll(pollMaxMs, TimeUnit.MILLISECONDS); http://git-wip-us.apache.org/repos/asf/curator/blob/23554479/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java index 7407eab..15781dc 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java @@ -195,7 +195,6 @@ public class TestFrameworkEdges extends BaseClassForTests @Test public void testGetAclNoStat() throws Exception { - CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1)); client.start(); try