Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-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 75EC1185C4 for ; Tue, 3 Nov 2015 19:38:53 +0000 (UTC) Received: (qmail 45745 invoked by uid 500); 3 Nov 2015 19:38:53 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 45714 invoked by uid 500); 3 Nov 2015 19:38:53 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 45695 invoked by uid 99); 3 Nov 2015 19:38:52 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2015 19:38:52 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 74812180A69 for ; Tue, 3 Nov 2015 19:38:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id HM9xjS0Vxjwo for ; Tue, 3 Nov 2015 19:38:38 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 5C18223882 for ; Tue, 3 Nov 2015 19:38:34 +0000 (UTC) Received: (qmail 42913 invoked by uid 99); 3 Nov 2015 19:38:34 -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, 03 Nov 2015 19:38:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 161FBE109C; Tue, 3 Nov 2015 19:38:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dschneider@apache.org To: commits@geode.incubator.apache.org Date: Tue, 03 Nov 2015 19:38:49 -0000 Message-Id: <7f244144117a44fb8d4e07f261eecd42@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [17/35] incubator-geode git commit: GEODE-411: fix suspect string on disconnect GEODE-411: fix suspect string on disconnect DistributionManager now has a isCloseInProgress method that checks both the volatile closeInProgress boolean and ask its DistributedSystem if it is disconnecting. This new method is used in places that decide if a warning should be logged. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/5f603b64 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/5f603b64 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/5f603b64 Branch: refs/heads/develop Commit: 5f603b64f7ba759ca025eb5890f5d2c83d4f3d09 Parents: 6116054 Author: Darrel Schneider Authored: Tue Oct 27 16:26:59 2015 -0700 Committer: Darrel Schneider Committed: Wed Oct 28 09:54:28 2015 -0700 ---------------------------------------------------------------------- .../internal/DistributionManager.java | 42 +++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/5f603b64/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionManager.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionManager.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionManager.java index 37f355f..f32f408 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionManager.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionManager.java @@ -718,7 +718,7 @@ public class DistributionManager // error condition, so you also need to check to see if the JVM // is still usable: SystemFailure.checkFailure(); - if (closeInProgress) { + if (isCloseInProgress()) { logger.debug("Caught unusual exception during shutdown: {}", t.getMessage(), t); } else { @@ -2486,7 +2486,7 @@ public class DistributionManager try { listener.memberJoined(id); } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -2503,7 +2503,7 @@ public class DistributionManager try { listener.memberJoined(id); } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -2515,6 +2515,20 @@ public class DistributionManager } } } + /** + * Returns true if this DM or the DistributedSystem owned by + * it is closing or is closed. + */ + private boolean isCloseInProgress() { + if (closeInProgress) { + return true; + } + InternalDistributedSystem ds = getSystem(); + if (ds != null && ds.isDisconnecting()) { + return true; + } + return false; + } private void handleCrashEvent(MemberCrashedEvent ev) { InternalDistributedMember id = ev.getId(); for (Iterator iter = membershipListeners.keySet().iterator(); @@ -2523,7 +2537,7 @@ public class DistributionManager try { listener.memberDeparted(id, true/*crashed*/); } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -2540,7 +2554,7 @@ public class DistributionManager try { listener.memberDeparted(id, true/*crashed*/); } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -2562,7 +2576,7 @@ public class DistributionManager try { listener.memberDeparted(id, false); } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -2579,7 +2593,7 @@ public class DistributionManager try { listener.memberDeparted(id, false); } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -2600,7 +2614,7 @@ public class DistributionManager try { listener.memberSuspect(id, whoSuspected); } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -2617,7 +2631,7 @@ public class DistributionManager try { listener.memberSuspect(id, whoSuspected); } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -2644,7 +2658,7 @@ public class DistributionManager try { listener.quorumLost(ev.getFailures(), ev.getRemaining()); } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -2661,7 +2675,7 @@ public class DistributionManager try { listener.quorumLost(ev.getFailures(), ev.getRemaining()); } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -2764,7 +2778,7 @@ public class DistributionManager handleMemberEvent(ev); } catch (InterruptedException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: InterruptedException during shutdown"); } @@ -2778,7 +2792,7 @@ public class DistributionManager break; } catch (CancelException e) { - if (closeInProgress) { + if (isCloseInProgress()) { if (logger.isTraceEnabled()) { logger.trace("MemberEventInvoker: cancelled"); } @@ -3613,7 +3627,7 @@ public class DistributionManager this.stats.incNodes(-1); } StringId msg; - if (crashed && ! this.closeInProgress) { + if (crashed && ! isCloseInProgress()) { msg = LocalizedStrings.DistributionManager_MEMBER_AT_0_UNEXPECTEDLY_LEFT_THE_DISTRIBUTED_CACHE_1; addMemberEvent(new MemberCrashedEvent(theId, reason)); } else {