curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cammcken...@apache.org
Subject [6/7] curator git commit: # noissue - Updated LOST handling so that the poll will only take 1/2 the session timeout if the SUSPENDED state has not yet been reached. Reduced waiting time on semaphore test.
Date Tue, 14 Jun 2016 22:22:55 GMT
 # noissue - Updated LOST handling so that the poll will only take 1/2 the session timeout
if the SUSPENDED state has not yet been reached. Reduced waiting time on semaphore test.


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0559df58
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0559df58
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0559df58

Branch: refs/heads/CURATOR-3.0
Commit: 0559df588ca724540ba2f6e3f1889190586dd18e
Parents: ef36275
Author: Cam McKenzie <cammckenzie@apache.org>
Authored: Tue Jun 14 14:12:15 2016 +1000
Committer: Cam McKenzie <cammckenzie@apache.org>
Committed: Tue Jun 14 14:12:15 2016 +1000

----------------------------------------------------------------------
 .../org/apache/curator/framework/state/ConnectionStateManager.java | 2 +-
 .../curator/framework/recipes/locks/TestInterProcessSemaphore.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/0559df58/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 c420a12..56c2250 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
@@ -252,7 +252,7 @@ public class ConnectionStateManager implements Closeable
             {
                 int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs();
                 int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs
: sessionTimeoutMs;
-                long elapsedMs = startOfSuspendedEpoch == 0 ? 0 : System.currentTimeMillis()
- startOfSuspendedEpoch;
+                long elapsedMs = startOfSuspendedEpoch == 0 ? useSessionTimeoutMs / 2 : System.currentTimeMillis()
- startOfSuspendedEpoch;
                 long pollMaxMs = useSessionTimeoutMs - elapsedMs;
 
                 final ConnectionState newState = eventQueue.poll(pollMaxMs, TimeUnit.MILLISECONDS);

http://git-wip-us.apache.org/repos/asf/curator/blob/0559df58/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
index 079b12c..488b776 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
@@ -150,7 +150,7 @@ public class TestInterProcessSemaphore extends BaseClassForTests
             });
       
             server.stop();
-            Assert.assertTrue(timing.multiple(2).awaitLatch(lostLatch));
+            Assert.assertTrue(timing.multiple(1.25).awaitLatch(lostLatch));
             InterProcessSemaphoreV2.debugAcquireLatch.countDown();  // the waiting semaphore
proceeds to getChildren - which should fail
             Assert.assertTrue(timing.awaitLatch(InterProcessSemaphoreV2.debugFailedGetChildrenLatch));
 // wait until getChildren fails
 


Mime
View raw message