Commons JCS
  1. Commons JCS
  2. JCS-100

JCS never going out of the dispose methode

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: jcs-1.3
    • Fix Version/s: None
    • Component/s: Composite Cache
    • Labels:
      None
    • Environment:
      Windows

      Description

      I have an application using many threads all calling JCS. When I close the application, the cache is usually working fine, but sometime, it stays stucked on the dispose methode.

      The cacheEventQueue never going empty. Then it's looping on while ( keepGoing ) and never ending. I have to kill the application to exit.

      It's difficult to reproduce. There is no fixed pattern so far.

        Activity

        Hide
        Jean-Marc Spaggiari added a comment -

        Thanks Thomas. I have been able to extract to trunk and build it. I will try the application locally first, then push it on the servers and see if it's having the same issue. If so, I wlil update this ticket.

        Show
        Jean-Marc Spaggiari added a comment - Thanks Thomas. I have been able to extract to trunk and build it. I will try the application locally first, then push it on the servers and see if it's having the same issue. If so, I wlil update this ticket.
        Hide
        Thomas Vandahl added a comment -

        JCS uses Maven 2 (2.2.1) for building. "mvn clean package" should be all you need.

        Show
        Thomas Vandahl added a comment - JCS uses Maven 2 (2.2.1) for building. "mvn clean package" should be all you need.
        Hide
        Jean-Marc Spaggiari added a comment -

        Hi Thomas Vandahl, I have not been able to fund a trunk build, so I have extracted the trunk source. Can you let me know how to build it so I can try with it?

        Thanks.

        Show
        Jean-Marc Spaggiari added a comment - Hi Thomas Vandahl , I have not been able to fund a trunk build, so I have extracted the trunk source. Can you let me know how to build it so I can try with it? Thanks.
        Hide
        Thomas Vandahl added a comment -

        I'm sorry to hear that. Does the current trunk show the same behavior? A lot of those race-condition-type issues have been addressed.

        Show
        Thomas Vandahl added a comment - I'm sorry to hear that. Does the current trunk show the same behavior? A lot of those race-condition-type issues have been addressed.
        Hide
        Jean-Marc Spaggiari added a comment -

        I'm now facing this issue daily. Same application, linux box. I'm not 100% sure what I shoud look at or share to investigate that...

        Show
        Jean-Marc Spaggiari added a comment - I'm now facing this issue daily. Same application, linux box. I'm not 100% sure what I shoud look at or share to investigate that...
        Hide
        Jean-Marc Spaggiari added a comment -

        I got the issue again today.

        This time, I was able to capture some other logs before the dispose goes in close loop.

        Can this be because the IndexedDiskCache failed to write one key that the cacheEventQueue is never cleared?

        2012-12-01 10:56:53,588 [CacheEventQueue.QProcessor-robotCache] ERROR org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache - Region [robotCache] Failure updating element, key: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa old: null
        java.lang.InterruptedException
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:503)
        at EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock$WriterLock.acquire(WriterPreferenceReadWriteLock.java:240)
        at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doUpdate(IndexedDiskCache.java:433)
        at org.apache.jcs.auxiliary.disk.AbstractDiskCache$MyCacheListener.handlePut(AbstractDiskCache.java:603)
        at org.apache.jcs.engine.CacheEventQueue$PutEvent.doRun(CacheEventQueue.java:688)
        at org.apache.jcs.engine.CacheEventQueue$AbstractCacheEvent.run(CacheEventQueue.java:607)
        at org.apache.jcs.engine.CacheEventQueue$QProcessor.run(CacheEventQueue.java:575)
        2012-12-01 10:56:53,867 [IndexedDiskCache-OptimizationThread] INFO org.apache.jcs.auxiliary.disk.indexed.IndexedDisk - Trucating file [C:\workspace\bbbbbbbbbb\robotCache\robotCache.data] to 367498133

        Show
        Jean-Marc Spaggiari added a comment - I got the issue again today. This time, I was able to capture some other logs before the dispose goes in close loop. Can this be because the IndexedDiskCache failed to write one key that the cacheEventQueue is never cleared? 2012-12-01 10:56:53,588 [CacheEventQueue.QProcessor-robotCache] ERROR org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache - Region [robotCache] Failure updating element, key: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa old: null java.lang.InterruptedException at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:503) at EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock$WriterLock.acquire(WriterPreferenceReadWriteLock.java:240) at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doUpdate(IndexedDiskCache.java:433) at org.apache.jcs.auxiliary.disk.AbstractDiskCache$MyCacheListener.handlePut(AbstractDiskCache.java:603) at org.apache.jcs.engine.CacheEventQueue$PutEvent.doRun(CacheEventQueue.java:688) at org.apache.jcs.engine.CacheEventQueue$AbstractCacheEvent.run(CacheEventQueue.java:607) at org.apache.jcs.engine.CacheEventQueue$QProcessor.run(CacheEventQueue.java:575) 2012-12-01 10:56:53,867 [IndexedDiskCache-OptimizationThread] INFO org.apache.jcs.auxiliary.disk.indexed.IndexedDisk - Trucating file [C:\workspace\bbbbbbbbbb\robotCache\robotCache.data] to 367498133
        Hide
        Jean-Marc Spaggiari added a comment -

        Hi Thomas,

        Application is running under Windows.

        Here is the application configuration:

        			Properties props = new Properties();
        			//# DEFAULT CACHE REGION
        			//# sets the default aux value for any non configured caches
        			props.put("jcs.default", "");
        			props.put("jcs.default.cacheattributes", "org.apache.jcs.engine.CompositeCacheAttributes");
        			props.put("jcs.default.cacheattributes.MaxObjects", "10000");
        			props.put("jcs.default.cacheattributes.MemoryCacheName", "org.apache.jcs.engine.memory.lru.LRUMemoryCache");
        			props.put("jcs.default.elementattributes.IsEternal", "false");
        			props.put("jcs.default.elementattributes.MaxLifeSeconds", "86400");
        			props.put("jcs.default.elementattributes.IdleTime", "1800");
        			//props.put("jcs.default.elementattributes.IsSpool", "true");
        			//props.put("jcs.default.elementattributes.IsRemote", "false");
        			//props.put("jcs.default.elementattributes.IsLateral", "false");
        			//# CACHE REGIONS AVAILABLE
        			//# Regions preconfigured for caching
        			props.put("jcs.region.robotCache", "DC");
        			props.put("jcs.region.robotCache.cacheattributes", "org.apache.jcs.engine.CompositeCacheAttributes");
        			props.put("jcs.region.robotCache.cacheattributes.MaxObjects", "131072");
        			props.put("jcs.region.robotCache.cacheattributes.MemoryCacheName", "org.apache.jcs.engine.memory.lru.LRUMemoryCache");
        			props.put("jcs.region.robotCache.cacheattributes.UseMemoryShrinker", "true");
        			props.put("jcs.region.robotCache.elementattributes.IsEternal", "false");
        			props.put("jcs.region.robotCache.elementattributes.MaxLifeSeconds", "604800");
        			props.put("jcs.region.robotCache.elementattributes.IdleTime", "1800");
        			props.put("jcs.region.robotCache.elementattributes.IsSpool", "true");
        			props.put("jcs.region.robotCache.elementattributes.IsRemote", "false");
        			props.put("jcs.region.robotCache.elementattributes.IsLateral", "false");
        			props.put("jcs.region.lastDomainAccessCache", "");
        			props.put("jcs.region.lastDomainAccessCache.cacheattributes", "org.apache.jcs.engine.CompositeCacheAttributes");
        			props.put("jcs.region.lastDomainAccessCache.cacheattributes.MaxObjects", "1000");
        			props.put("jcs.region.lastDomainAccessCache.cacheattributes.MemoryCacheName", "org.apache.jcs.engine.memory.lru.LRUMemoryCache");
        			props.put("jcs.region.lastDomainAccessCache.elementattributes.IsEternal", "false");
        			props.put("jcs.region.lastDomainAccessCache.elementattributes.MaxLifeSeconds", "60");
        			props.put("jcs.region.lastDomainAccessCache.elementattributes.IdleTime", "1800");
        			props.put("jcs.region.lastDomainAccessCache.elementattributes.IsSpool", "true");
        			props.put("jcs.region.lastDomainAccessCache.elementattributes.IsRemote", "false");
        			props.put("jcs.region.lastDomainAccessCache.elementattributes.IsLateral", "false");
        			//# AUXILIARY CACHES AVAILABLE
        			//# Primary Disk Cache -- faster than the rest because of memory key storage
        			props.put("jcs.auxiliary.DC", "org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory");
        			props.put("jcs.auxiliary.DC.attributes", "org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes");
        			props.put("jcs.auxiliary.DC.attributes.DiskPath", "robotCache");
        			props.put("jcs.auxiliary.DC.attributes.MaxPurgatorySize", "131072");
        			props.put("jcs.auxiliary.DC.attributes.MaxKeySize", "131072");
        			props.put("jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount", "32768");
        			props.put("jcs.auxiliary.DC.attributes.MaxRecycleBinSize", "32768");
        			props.put("jcs.auxiliary.DC.attributes.OptimizeOnShutdown", "true");
        
        			ccm.configure(props);
        

        I'm usually running about 50 threads accessing the cache at the same time. It's not easy to reproduce because sometime it's working fine, sometime it's not. I don't know what's making it failing. When it's blocked, is there any variable I should look at to help? I'm usually running the application in debug mode on Eclipse.

        Thanks.

        Show
        Jean-Marc Spaggiari added a comment - Hi Thomas, Application is running under Windows. Here is the application configuration: Properties props = new Properties(); //# DEFAULT CACHE REGION //# sets the default aux value for any non configured caches props.put( "jcs. default " , ""); props.put( "jcs. default .cacheattributes" , "org.apache.jcs.engine.CompositeCacheAttributes" ); props.put( "jcs. default .cacheattributes.MaxObjects" , "10000" ); props.put( "jcs. default .cacheattributes.MemoryCacheName" , "org.apache.jcs.engine.memory.lru.LRUMemoryCache" ); props.put( "jcs. default .elementattributes.IsEternal" , " false " ); props.put( "jcs. default .elementattributes.MaxLifeSeconds" , "86400" ); props.put( "jcs. default .elementattributes.IdleTime" , "1800" ); //props.put( "jcs. default .elementattributes.IsSpool" , " true " ); //props.put( "jcs. default .elementattributes.IsRemote" , " false " ); //props.put( "jcs. default .elementattributes.IsLateral" , " false " ); //# CACHE REGIONS AVAILABLE //# Regions preconfigured for caching props.put( "jcs.region.robotCache" , "DC" ); props.put( "jcs.region.robotCache.cacheattributes" , "org.apache.jcs.engine.CompositeCacheAttributes" ); props.put( "jcs.region.robotCache.cacheattributes.MaxObjects" , "131072" ); props.put( "jcs.region.robotCache.cacheattributes.MemoryCacheName" , "org.apache.jcs.engine.memory.lru.LRUMemoryCache" ); props.put( "jcs.region.robotCache.cacheattributes.UseMemoryShrinker" , " true " ); props.put( "jcs.region.robotCache.elementattributes.IsEternal" , " false " ); props.put( "jcs.region.robotCache.elementattributes.MaxLifeSeconds" , "604800" ); props.put( "jcs.region.robotCache.elementattributes.IdleTime" , "1800" ); props.put( "jcs.region.robotCache.elementattributes.IsSpool" , " true " ); props.put( "jcs.region.robotCache.elementattributes.IsRemote" , " false " ); props.put( "jcs.region.robotCache.elementattributes.IsLateral" , " false " ); props.put( "jcs.region.lastDomainAccessCache" , ""); props.put( "jcs.region.lastDomainAccessCache.cacheattributes" , "org.apache.jcs.engine.CompositeCacheAttributes" ); props.put( "jcs.region.lastDomainAccessCache.cacheattributes.MaxObjects" , "1000" ); props.put( "jcs.region.lastDomainAccessCache.cacheattributes.MemoryCacheName" , "org.apache.jcs.engine.memory.lru.LRUMemoryCache" ); props.put( "jcs.region.lastDomainAccessCache.elementattributes.IsEternal" , " false " ); props.put( "jcs.region.lastDomainAccessCache.elementattributes.MaxLifeSeconds" , "60" ); props.put( "jcs.region.lastDomainAccessCache.elementattributes.IdleTime" , "1800" ); props.put( "jcs.region.lastDomainAccessCache.elementattributes.IsSpool" , " true " ); props.put( "jcs.region.lastDomainAccessCache.elementattributes.IsRemote" , " false " ); props.put( "jcs.region.lastDomainAccessCache.elementattributes.IsLateral" , " false " ); //# AUXILIARY CACHES AVAILABLE //# Primary Disk Cache -- faster than the rest because of memory key storage props.put( "jcs.auxiliary.DC" , "org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory" ); props.put( "jcs.auxiliary.DC.attributes" , "org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes" ); props.put( "jcs.auxiliary.DC.attributes.DiskPath" , "robotCache" ); props.put( "jcs.auxiliary.DC.attributes.MaxPurgatorySize" , "131072" ); props.put( "jcs.auxiliary.DC.attributes.MaxKeySize" , "131072" ); props.put( "jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount" , "32768" ); props.put( "jcs.auxiliary.DC.attributes.MaxRecycleBinSize" , "32768" ); props.put( "jcs.auxiliary.DC.attributes.OptimizeOnShutdown" , " true " ); ccm.configure(props); I'm usually running about 50 threads accessing the cache at the same time. It's not easy to reproduce because sometime it's working fine, sometime it's not. I don't know what's making it failing. When it's blocked, is there any variable I should look at to help? I'm usually running the application in debug mode on Eclipse. Thanks.
        Hide
        Thomas Vandahl added a comment -

        There is not much we can do with this issue description. Any more information on the environment, the configuration etc?

        Show
        Thomas Vandahl added a comment - There is not much we can do with this issue description. Any more information on the environment, the configuration etc?

          People

          • Assignee:
            Unassigned
            Reporter:
            Jean-Marc Spaggiari
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development