[infinispan-commits] Infinispan SVN: r2490 - in trunk/core/src: test/java/org/infinispan/test and 1 other directory.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Mon Oct 4 14:12:44 EDT 2010


Author: vblagojevic at jboss.com
Date: 2010-10-04 14:12:44 -0400 (Mon, 04 Oct 2010)
New Revision: 2490

Modified:
   trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java
   trunk/core/src/test/java/org/infinispan/test/TestingUtil.java
Log:
merge 2488 and 2489 from 4.2 branch

Modified: trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java	2010-10-04 17:55:32 UTC (rev 2489)
+++ trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java	2010-10-04 18:12:44 UTC (rev 2490)
@@ -485,13 +485,15 @@
       c.assertValid();
       Cache cache = new InternalCacheFactory().createCache(c, globalComponentRegistry, cacheName);
       CacheWrapper cw = new CacheWrapper(cache);
-      existingCache = caches.putIfAbsent(cacheName, cw);
-      if (existingCache != null) {
-         throw new IllegalStateException("attempt to initialize the cache twice");
+      try {
+         existingCache = caches.putIfAbsent(cacheName, cw);
+         if (existingCache != null) {
+            throw new IllegalStateException("attempt to initialize the cache twice");
+         }
+         cache.start();
+      } finally {
+         cw.latch.countDown();
       }
-
-      cache.start();
-      cw.latch.countDown();
       return cache;
    }
 

Modified: trunk/core/src/test/java/org/infinispan/test/TestingUtil.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/test/TestingUtil.java	2010-10-04 17:55:32 UTC (rev 2489)
+++ trunk/core/src/test/java/org/infinispan/test/TestingUtil.java	2010-10-04 18:12:44 UTC (rev 2490)
@@ -430,10 +430,13 @@
       if (cacheContainers != null) {
          for (EmbeddedCacheManager cm : cacheContainers) {
             try {
-               clearContent(cm);
-            } finally {
-               if (cm != null)
+               try {
+                  clearContent(cm);
+               } finally {
                   cm.stop();
+               }
+            } catch (Throwable e) {
+               log.warn("Problems killing cache manager " + cm, e);
             }
          }
       }



More information about the infinispan-commits mailing list