curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject git commit: Warn if session timeout is less than connection timeout
Date Wed, 25 Sep 2013 03:28:47 GMT
Updated Branches:
  refs/heads/master 17bcca995 -> bb663fd30


Warn if session timeout is less than connection timeout


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

Branch: refs/heads/master
Commit: bb663fd302aab65eb43f7d3bc579ec1ee8096117
Parents: 17bcca9
Author: randgalt <randgalt@apache.org>
Authored: Tue Sep 24 20:29:54 2013 -0700
Committer: randgalt <randgalt@apache.org>
Committed: Tue Sep 24 20:29:54 2013 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/curator/CuratorZookeeperClient.java    | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-curator/blob/bb663fd3/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java b/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
index f633fe1..ee9cf88 100644
--- a/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
+++ b/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
@@ -89,6 +89,11 @@ public class CuratorZookeeperClient implements Closeable
      */
     public CuratorZookeeperClient(ZookeeperFactory zookeeperFactory, EnsembleProvider ensembleProvider,
int sessionTimeoutMs, int connectionTimeoutMs, Watcher watcher, RetryPolicy retryPolicy, boolean
canBeReadOnly)
     {
+        if ( sessionTimeoutMs < connectionTimeoutMs )
+        {
+            log.warn(String.format("session timeout [%d] is less than connection timeout
[%d]", sessionTimeoutMs, connectionTimeoutMs));
+        }
+
         retryPolicy = Preconditions.checkNotNull(retryPolicy, "retryPolicy cannot be null");
         ensembleProvider = Preconditions.checkNotNull(ensembleProvider, "ensembleProvider
cannot be null");
 


Mime
View raw message