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 Tue, 20 Oct 2015 18:19:49 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-392 [created] 13018f95c


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/13018f95
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/13018f95
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/13018f95

Branch: refs/heads/feature/GEODE-392
Commit: 13018f95c1c7b0af90241461a580ed39ee82811f
Parents: f5a44dc
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Tue Oct 20 11:17:47 2015 -0700
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Tue Oct 20 11:17:47 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/13018f95/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