Return-Path: X-Original-To: apmail-curator-commits-archive@minotaur.apache.org Delivered-To: apmail-curator-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D577518CE3 for ; Tue, 1 Sep 2015 13:02:26 +0000 (UTC) Received: (qmail 60681 invoked by uid 500); 1 Sep 2015 13:02:26 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 60647 invoked by uid 500); 1 Sep 2015 13:02:26 -0000 Mailing-List: contact commits-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list commits@curator.apache.org Received: (qmail 60340 invoked by uid 99); 1 Sep 2015 13:02:26 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2015 13:02:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6BD03DFF8C; Tue, 1 Sep 2015 13:02:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randgalt@apache.org To: commits@curator.apache.org Date: Tue, 01 Sep 2015 13:02:45 -0000 Message-Id: In-Reply-To: <881087f9832f4ae08cb5006b17f6dd3f@git.apache.org> References: <881087f9832f4ae08cb5006b17f6dd3f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [21/29] curator git commit: code for useSessionTimeoutMs was wrong code for useSessionTimeoutMs was wrong Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/dd788163 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/dd788163 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/dd788163 Branch: refs/heads/CURATOR-3.0 Commit: dd788163a278e2c10f71d2f0fd8b68137806f9f0 Parents: 966b8df Author: randgalt Authored: Sun Aug 23 20:33:55 2015 -0500 Committer: randgalt Committed: Sun Aug 23 20:33:55 2015 -0500 ---------------------------------------------------------------------- .../apache/curator/framework/state/ConnectionStateManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/dd788163/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 3da7534..de71264 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 @@ -292,7 +292,8 @@ public class ConnectionStateManager implements Closeable if ( (currentConnectionState == ConnectionState.SUSPENDED) && (startOfSuspendedEpoch != 0) ) { long elapsedMs = System.currentTimeMillis() - startOfSuspendedEpoch; - int useSessionTimeoutMs = Math.max(client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(), sessionTimeoutMs); + int lastNegotiatedSessionTimeoutMs = client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs(); + int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs > 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs; if ( elapsedMs >= useSessionTimeoutMs ) { log.warn(String.format("Session timeout has elapsed while SUSPENDED. Posting LOST event and resetting the connection. Elapsed ms: %d. Session Timeout ms: %d", elapsedMs, useSessionTimeoutMs));