pzampino commented on code in PR #1053:
URL: https://github.com/apache/knox/pull/1053#discussion_r2129136982


##########
gateway-provider-security-shiro/src/main/java/org/apache/knox/gateway/shirorealm/KnoxCacheManager.java:
##########
@@ -113,13 +114,17 @@ private org.ehcache.CacheManager ensureCacheManager() 
throws MalformedURLExcepti
       try {
         manager.init();
       } catch (StateTransitionException e) {
-        LOG.resolvePersistenceDirLockError(e.getMessage());
-        this.resolveLockConflict(xmlConfiguration);
-        if(manager.getStatus() != Status.UNINITIALIZED) {
+        if(containsOverlappingFileLockException(e)) {
+          LOG.resolvePersistenceDirLockError(e.getMessage());
+          this.resolveLockConflict(xmlConfiguration);
+          if(manager.getStatus() != Status.UNINITIALIZED) {
             manager.close();
+          }
+          manager = CacheManagerBuilder.newCacheManager(xmlConfiguration);
+          manager.init();
+        } else {
+          throw e;

Review Comment:
   e is the result of getCause() at this point? Is that your intention?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@knox.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to