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 73C38200BBA for ; Sat, 22 Oct 2016 06:31:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 72504160AE8; Sat, 22 Oct 2016 04:31:01 +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 B4994160AE9 for ; Sat, 22 Oct 2016 06:31:00 +0200 (CEST) Received: (qmail 82429 invoked by uid 500); 22 Oct 2016 04:30:59 -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 82415 invoked by uid 99); 22 Oct 2016 04:30:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Oct 2016 04:30:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 02F96C1275 for ; Sat, 22 Oct 2016 04:30:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id td9mMFsr32Fn for ; Sat, 22 Oct 2016 04:30:56 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id C185C5FBFE for ; Sat, 22 Oct 2016 04:30:55 +0000 (UTC) Received: (qmail 82294 invoked by uid 99); 22 Oct 2016 04:30: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; Sat, 22 Oct 2016 04:30:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 71509E0ADC; Sat, 22 Oct 2016 04:30:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hiteshkhamesra@apache.org To: commits@geode.incubator.apache.org Date: Sat, 22 Oct 2016 04:30:54 -0000 Message-Id: <2a28da35412b4eaeb18b889191f1d08a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] incubator-geode git commit: GEODE-2011 Client code which clears pdx registry needs synchronization archived-at: Sat, 22 Oct 2016 04:31:01 -0000 Repository: incubator-geode Updated Branches: refs/heads/develop 8bf395714 -> 24a72040c GEODE-2011 Client code which clears pdx registry needs synchronization We clear pdx registry in client when we re-connect to cluster. But during that time other thread may end up using old registry while other thread is clearing this. Thus we need to synchronize that. In current code it happens through listener events and I modified that notification to synchronize this. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/6eb0fd39 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/6eb0fd39 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/6eb0fd39 Branch: refs/heads/develop Commit: 6eb0fd398e9bff7798939df6781aa52979ef9693 Parents: 8bf3957 Author: Hitesh Khamesra Authored: Fri Oct 21 15:52:00 2016 -0700 Committer: Hitesh Khamesra Committed: Fri Oct 21 15:52:00 2016 -0700 ---------------------------------------------------------------------- .../cache/client/internal/EndpointManagerImpl.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6eb0fd39/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java index f594278..ec8a818 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java @@ -77,6 +77,7 @@ public class EndpointManagerImpl implements EndpointManager { Map endpointMapTemp = new HashMap(endpointMap); endpoint = new Endpoint(this, ds, server, stats, memberId); + listener.clearPdxRegistry(endpoint); endpointMapTemp.put(server, endpoint); endpointMap = Collections.unmodifiableMap(endpointMapTemp); addedEndpoint = true; @@ -291,9 +292,21 @@ public class EndpointManagerImpl implements EndpointManager { // logger.warn("HIGHUP:JOIN:"+endpoint.getLocation()); for (Iterator itr = endpointListeners.iterator(); itr.hasNext();) { EndpointManager.EndpointListener listener = itr.next(); - listener.endpointNowInUse(endpoint); + if (!(listener instanceof PdxRegistryRecoveryListener)) { + listener.endpointNowInUse(endpoint); + } + } + } + + public void clearPdxRegistry(Endpoint endpoint) { + for (Iterator itr = endpointListeners.iterator(); itr.hasNext();) { + EndpointManager.EndpointListener listener = itr.next(); + if (listener instanceof PdxRegistryRecoveryListener) { + listener.endpointNowInUse(endpoint); + } } } + }