Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E0F78200BAC for ; Wed, 12 Oct 2016 00:47:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DF89A160AF4; Tue, 11 Oct 2016 22:47:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 09BE6160AF3 for ; Wed, 12 Oct 2016 00:47:58 +0200 (CEST) Received: (qmail 82224 invoked by uid 500); 11 Oct 2016 22:47:57 -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 82213 invoked by uid 99); 11 Oct 2016 22:47:57 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2016 22:47:57 +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 56B41180227 for ; Tue, 11 Oct 2016 22:47:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 7vR1eXRogOub for ; Tue, 11 Oct 2016 22:47:55 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id A6BF15F4EC for ; Tue, 11 Oct 2016 22:47:54 +0000 (UTC) Received: (qmail 82155 invoked by uid 99); 11 Oct 2016 22:47:54 -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, 11 Oct 2016 22:47:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 24BAEDFF55; Tue, 11 Oct 2016 22:47:54 +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 Message-Id: <13518fca294c4c3b8070ba0271a55fbf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-geode git commit: changed to an AtomicBoolean, remove cache sync on addPartitionedRegion and requiresNotificationFromPR Date: Tue, 11 Oct 2016 22:47:54 +0000 (UTC) archived-at: Tue, 11 Oct 2016 22:48:00 -0000 Repository: incubator-geode Updated Branches: refs/heads/feature/GEM-983 35441b8aa -> 7f920879a changed to an AtomicBoolean, remove cache sync on addPartitionedRegion and requiresNotificationFromPR Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/7f920879 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/7f920879 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/7f920879 Branch: refs/heads/feature/GEM-983 Commit: 7f920879a7b75f8ffc624eadd34fe63dff27ffb8 Parents: 35441b8 Author: Darrel Schneider Authored: Tue Oct 11 15:47:45 2016 -0700 Committer: Darrel Schneider Committed: Tue Oct 11 15:47:45 2016 -0700 ---------------------------------------------------------------------- .../geode/internal/cache/GemFireCacheImpl.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7f920879/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java index de23cc3..9da3e79 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java @@ -523,7 +523,7 @@ public class GemFireCacheImpl implements InternalCache, ClientCache, HasCachePer private final Object clientMetaDatServiceLock = new Object(); - private volatile boolean isShutDownAll = false; + private final AtomicBoolean isShutDownAll = new AtomicBoolean(false); private final ResourceAdvisor resourceAdvisor; private final JmxManagerAdvisor jmxAdvisor; @@ -642,7 +642,7 @@ public class GemFireCacheImpl implements InternalCache, ClientCache, HasCachePer sb.append("GemFireCache["); sb.append("id = " + System.identityHashCode(this)); sb.append("; isClosing = " + this.isClosing); - sb.append("; isShutDownAll = " + this.isShutDownAll); + sb.append("; isShutDownAll = " + isCacheAtShutdownAll()); sb.append("; created = " + this.creationDate); sb.append("; server = " + this.isServer); sb.append("; copyOnRead = " + this.copyOnRead); @@ -1641,7 +1641,7 @@ public class GemFireCacheImpl implements InternalCache, ClientCache, HasCachePer } public boolean isCacheAtShutdownAll() { - return isShutDownAll; + return isShutDownAll.get(); } /** @@ -1656,8 +1656,6 @@ public class GemFireCacheImpl implements InternalCache, ClientCache, HasCachePer } public void shutDownAll() { - synchronized(GemFireCacheImpl.class) { - synchronized(this) { boolean testIGE = Boolean.getBoolean("TestInternalGemFireError"); if (testIGE) { @@ -1675,8 +1673,13 @@ public class GemFireCacheImpl implements InternalCache, ClientCache, HasCachePer LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false; } } - this.isShutDownAll = true; + if (!this.isShutDownAll.compareAndSet(false, true)) { + // it's already doing shutdown by another thread + return; + } + synchronized(GemFireCacheImpl.class) { + synchronized(this) { // bug 44031 requires multithread shutdownall should be grouped // by root region. However, shutDownAllDuringRecovery.conf test revealed that // we have to close colocated child regions first. @@ -4058,7 +4061,6 @@ public class GemFireCacheImpl implements InternalCache, ClientCache, HasCachePer * cache requires, or does not require notification of all region/entry events. */ public void addPartitionedRegion(PartitionedRegion r) { - synchronized (GemFireCacheImpl.class) { synchronized (this.partitionedRegions) { if (r.isDestroyed()) { if (logger.isDebugEnabled()) { @@ -4070,7 +4072,6 @@ public class GemFireCacheImpl implements InternalCache, ClientCache, HasCachePer getCachePerfStats().incPartitionedRegions(1); } } - } } /** @@ -4163,7 +4164,6 @@ public class GemFireCacheImpl implements InternalCache, ClientCache, HasCachePer * @return true if the region should deliver all of its events to this cache */ protected boolean requiresNotificationFromPR(PartitionedRegion r) { - synchronized (GemFireCacheImpl.class) { boolean hasSerialSenders = hasSerialSenders(r); boolean result = hasSerialSenders; if (!result) { @@ -4178,7 +4178,6 @@ public class GemFireCacheImpl implements InternalCache, ClientCache, HasCachePer } return result; - } } private boolean hasSerialSenders(PartitionedRegion r) {