geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [32/50] [abbrv] incubator-geode git commit: GEODE-518: fix intermittent EntryNotFoundException
Date Thu, 05 Nov 2015 20:36:09 GMT
GEODE-518: fix intermittent EntryNotFoundException


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

Branch: refs/heads/feature/GEODE-77
Commit: fe7189b48380175f99cb81cc038a04ebf80103f4
Parents: 74ecbe1
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Mon Nov 2 10:04:48 2015 -0800
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Mon Nov 2 10:05:37 2015 -0800

----------------------------------------------------------------------
 .../gemfire/cache30/MultiVMRegionTestCase.java      | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fe7189b4/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
index bc0eb7f..6fada2b 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
@@ -4100,8 +4100,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
                 public boolean done() {
                   Region.Entry re = region.getEntry(key);
                   if (re != null) {
-                    LocalRegion lr = (LocalRegion) region;
-                    EntryExpiryTask eet = lr.getEntryExpiryTask(key);
+                    EntryExpiryTask eet = getEntryExpiryTask(region, key);
                     if (eet != null) {
                       logger.info("DEBUG: waiting for expire destroy expirationTime= " +
eet.getExpirationTime() + " now=" + eet.getNow() + " currentTimeMillis=" + System.currentTimeMillis());
                     } else {
@@ -4111,10 +4110,9 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase
{
                   return re == null;
                 }
                 public String description() {
-                  LocalRegion lr = (LocalRegion) region;
                   String expiryInfo = "";
                   try {
-                    EntryExpiryTask eet = lr.getEntryExpiryTask(key);
+                    EntryExpiryTask eet = getEntryExpiryTask(region, key);
                     if (eet != null) {
                       expiryInfo = "expirationTime= " + eet.getExpirationTime() + " now="
+ eet.getNow() + " currentTimeMillis=" + System.currentTimeMillis();
                     }
@@ -4139,6 +4137,16 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase
{
           }
         });
     }
+    
+    private static EntryExpiryTask getEntryExpiryTask(Region r, Object key) {
+      EntryExpiryTask result = null;
+      try {
+        LocalRegion lr = (LocalRegion) r;
+        result = lr.getEntryExpiryTask(key);
+      } catch (EntryNotFoundException ignore) {
+      }
+      return result;
+    }
 
     /**
      * Tests to makes sure that a distributed update resets the


Mime
View raw message