geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From esh...@apache.org
Subject [15/50] [abbrv] incubator-geode git commit: GEODE-1460 RemoveAll fails with NPE in com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier.checkAndRemoveFromClientMsgsRegion()
Date Tue, 31 May 2016 21:44:17 GMT
GEODE-1460 RemoveAll fails with NPE in com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier.checkAndRemoveFromClientMsgsRegion()

Make haContainer volatile.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/cd295f5b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/cd295f5b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/cd295f5b

Branch: refs/heads/feature/GEODE-1400
Commit: cd295f5b369176b6ddae15acf224cf288e2e30bf
Parents: 11e4b25
Author: Jianxia Chen <jchen@pivotal.io>
Authored: Fri May 27 09:49:25 2016 -0700
Committer: Jianxia Chen <jchen@pivotal.io>
Committed: Fri May 27 09:49:25 2016 -0700

----------------------------------------------------------------------
 .../com/gemstone/gemfire/internal/cache/AbstractRegionMap.java  | 3 +++
 .../internal/cache/tier/sockets/CacheClientNotifier.java        | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/cd295f5b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java
index 62336f0..0cbec19 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java
@@ -804,6 +804,9 @@ public abstract class AbstractRegionMap implements RegionMap {
         // server in the VM
         HAContainerWrapper haContainer = (HAContainerWrapper)CacheClientNotifier
             .getInstance().getHaContainer();
+        if (haContainer == null) {
+          return false;
+        }
         Map.Entry entry = null;
         HAEventWrapper original = null;
         synchronized (haContainer) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/cd295f5b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientNotifier.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientNotifier.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientNotifier.java
index 80d05ba..712244b 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientNotifier.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientNotifier.java
@@ -1433,6 +1433,9 @@ public class CacheClientNotifier {
    * @since 5.7
    */
   private void checkAndRemoveFromClientMsgsRegion(Conflatable conflatable) {
+    if (haContainer == null) {
+      return;
+    }
     if (conflatable instanceof HAEventWrapper) {
       HAEventWrapper wrapper = (HAEventWrapper)conflatable;
       if (!wrapper.getIsRefFromHAContainer()) {
@@ -2536,7 +2539,7 @@ public class CacheClientNotifier {
    * (in case of eviction policy "none"). In both the cases, it'll store
    * HAEventWrapper as its key and ClientUpdateMessage as its value.
    */
-  private HAContainerWrapper haContainer;
+  private volatile HAContainerWrapper haContainer;
 
   //   /**
   //    * The singleton <code>CacheClientNotifier</code> instance


Mime
View raw message