Repository: curator
Updated Branches:
  refs/heads/CURATOR-498 [created] dafd09141


CURATOR-498 - include session ID in log message for injecting session expiration


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

Branch: refs/heads/CURATOR-498
Commit: 4b0bc85d066f8582b55d76092c391bad04bd48a5
Parents: 219c881
Author: randgalt <[email protected]>
Authored: Mon Dec 31 03:24:02 2018 -0800
Committer: randgalt <[email protected]>
Committed: Mon Dec 31 03:24:02 2018 -0800

----------------------------------------------------------------------
 .../apache/curator/framework/state/ConnectionStateManager.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/4b0bc85d/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 5e28b3d..bbcb5c2 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
@@ -25,6 +25,7 @@ import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.listen.ListenerContainer;
 import org.apache.curator.utils.Compatibility;
 import org.apache.curator.utils.ThreadUtils;
+import org.apache.zookeeper.ZooKeeper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.io.Closeable;
@@ -302,10 +303,11 @@ public class ConnectionStateManager implements Closeable
             if ( elapsedMs >= useSessionTimeoutMs )
             {
                 startOfSuspendedEpoch = System.currentTimeMillis(); // reset 
startOfSuspendedEpoch to avoid spinning on this session expiration injection 
CURATOR-405
-                log.warn(String.format("Session timeout has elapsed while 
SUSPENDED. Injecting a session expiration. Elapsed ms: %d. Adjusted session 
timeout ms: %d", elapsedMs, useSessionTimeoutMs));
                 try
                 {
-                    
Compatibility.injectSessionExpiration(client.getZookeeperClient().getZooKeeper());
+                    ZooKeeper zooKeeper = 
client.getZookeeperClient().getZooKeeper();
+                    log.warn(String.format("Session timeout has elapsed while 
SUSPENDED. Injecting a session expiration. Elapsed ms: %d. Adjusted session 
timeout ms: %d. SessionId: 0x%s", elapsedMs, useSessionTimeoutMs, 
Long.toHexString(zooKeeper.getSessionId())));
+                    Compatibility.injectSessionExpiration(zooKeeper);
                 }
                 catch ( Exception e )
                 {

Reply via email to