EHC ❯ JCacheManager shutdown() locks improperly in combination with CacheManager.shutdown()
-
Bug
-
Status: Closed
-
2 Major
-
Resolution: Fixed
-
ehcache-jcache
-
-
amiller
-
Reporter: amiller
-
October 30, 2009
-
0
-
Watchers: 0
-
November 19, 2009
-
October 30, 2009
Description
JCacheManager subclasses CacheManager. The static shutdown() method (and create() methods) in CacheManager lock against CacheManager.class. JCacheManager’s shutdown() does this:
public void shutdown() {
synchronized (JCacheManager.class) {
if (status.equals(Status.STATUS_SHUTDOWN)) {
if (LOG.isDebugEnabled()) {
LOG.debug("CacheManager already shutdown");
}
return;
}
super.shutdown();
//only delete singleton if the singleton is shutting down.
if (this == singleton) {
singleton = null;
}
}
}
I think the intent here is to be locked against the same locks held in the JCacheManager.create() method which also uses CacheManager.class as a lock. I think the one use of JCacheManager.class should be changed to CacheManager.class.