[ 
https://issues.apache.org/jira/browse/KNOX-3156?focusedWorklogId=971988&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-971988
 ]

ASF GitHub Bot logged work on KNOX-3156:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Jun/25 16:50
            Start Date: 05/Jun/25 16:50
    Worklog Time Spent: 10m 
      Work Description: hanicz commented on code in PR #1053:
URL: https://github.com/apache/knox/pull/1053#discussion_r2129303125


##########
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:
   No, the 'e' here is the original StateTransitionException. The code only 
throws it if there was no locking exception in the getCause chain. 





Issue Time Tracking
-------------------

    Worklog Id:     (was: 971988)
    Time Spent: 1.5h  (was: 1h 20m)

> Improve Ehcache 3.x
> -------------------
>
>                 Key: KNOX-3156
>                 URL: https://issues.apache.org/jira/browse/KNOX-3156
>             Project: Apache Knox
>          Issue Type: Improvement
>    Affects Versions: 2.1.0
>            Reporter: Tamás Hanicz
>            Assignee: Tamás Hanicz
>            Priority: Major
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> * Add new ability to load Ehcache config file from a file that's not on the 
> classpath
>  * Knox should resolve lock dir exceptions on its own in case two topologies 
> use the same configuration file.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to