geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject incubator-geode git commit: GEODE-392: Removing catch Throwable from CacheTestCase.closeCache
Date Wed, 21 Oct 2015 16:04:20 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-409 07d55bda1 -> 25bce9646


GEODE-392: Removing catch Throwable from CacheTestCase.closeCache

I'm fairly certain that GEODE-392 was caused by cache.close throwing an
exception in this method. Later on, we delete the disk store files, and
then end up calling cache.close again in DistributedTestCase. The
failure we are seeing is because the disk store files are deleted but
the cache is still open.

Unfortunately, this catch throwable was swallowing all errors, so we
were not seeing failures that happened when closing the cache.


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

Branch: refs/heads/feature/GEODE-409
Commit: 25bce9646cc6f6d44212d0067d2d44bde0ad2268
Parents: 07d55bd
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Tue Oct 20 11:17:47 2015 -0700
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Wed Oct 21 09:01:59 2015 -0700

----------------------------------------------------------------------
 .../gemstone/gemfire/cache30/CacheTestCase.java | 36 ++++++--------------
 1 file changed, 11 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/25bce964/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java
index 951c985..856f6b3 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java
@@ -16,6 +16,8 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
 
+import org.apache.logging.log4j.Logger;
+
 import com.gemstone.gemfire.InternalGemFireError;
 import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -45,6 +47,7 @@ import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
+import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.org.jgroups.Event;
 import com.gemstone.org.jgroups.JChannel;
 import com.gemstone.org.jgroups.stack.Protocol;
@@ -62,6 +65,7 @@ import dunit.VM;
  * @since 3.0
  */
 public abstract class CacheTestCase extends DistributedTestCase {
+  private static final Logger logger = LogService.getLogger();
 
   /** The Cache from which regions are obtained 
    * 
@@ -402,19 +406,8 @@ public abstract class CacheTestCase extends DistributedTestCase {
               }
             }
           }
-          try {
-            cache.close();
-          }
-          catch (VirtualMachineError e) {
-            SystemFailure.initiateFailure(e);
-            throw e;
-          }
-          catch (Throwable t) {
-          }
-          finally {
-          }
+          cache.close();
         }
-        // @todo darrel: destroy DiskStore files
       }
       finally {
         cache = null;
@@ -460,21 +453,14 @@ public abstract class CacheTestCase extends DistributedTestCase {
       try {
         closeCache();
       }
-      catch (VirtualMachineError e) {
-        SystemFailure.initiateFailure(e);
-        throw e;
-      }
-      catch (Throwable t) {
-        getLogWriter().error("Error in closing the cache ", t);
-        
+      finally {
+        try {
+          cleanDiskDirs();
+        } catch(Exception e) {
+          getLogWriter().error("Error cleaning disk dirs", e);
+        }
       }
     }
-
-    try {
-      cleanDiskDirs();
-    } catch(IOException e) {
-      getLogWriter().error("Error cleaning disk dirs", e);
-    }
   }
 
   /**


Mime
View raw message