3 Replies Latest reply on May 20, 2006 12:18 AM by Yogesh Bhardwaj

    InterruptedException in JBossCache

    Yogesh Bhardwaj Newbie

      Hello all,

      I am using the cache (version 1.2.3) to store some serialized java objects that we hold in the database. I'm not using the persistent features of the cache, but just storing the objects after the first hit to the database. I don't need to evict the objects since they don't change very often (have another interface to forcefully evict the objects from the cache), so I have timeToIdleSeconds as 0. Everything is fine, but when we hit the application with about 25 simultaneous threads in a loop count of over 1000, the application just hangs after running fine for more than 2 hours. Looking at the thread dump, I saw the following trace in the logs:

      java.lang.InterruptedException
       at java.lang.Object.wait(Native Method)
       at java.lang.Object.wait(Object.java:429)
       at EDU.oswego.cs.dl.util.concurrent.BoundedBuffer.put(BoundedBuffer.java:109)
       at org.jboss.cache.eviction.Region.putNodeEvent(Region.java:101)
       at org.jboss.cache.eviction.Region.setVisitedNode(Region.java:91)
       at org.jboss.cache.eviction.LRUPolicy.nodeVisited(LRUPolicy.java:104)
       at org.jboss.cache.TreeCache.notifyNodeVisisted(TreeCache.java:3192)
       at org.jboss.cache.TreeCache._get(TreeCache.java:1564)
       at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jgroups.blocks.MethodCall.invoke(MethodCall.java:236)
       at org.jboss.cache.interceptors.CallInterceptor.invoke(CallInterceptor.java:33)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:41)
       at org.jboss.cache.interceptors.LockInterceptor.invoke(LockInterceptor.java:167)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:41)
       at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:35)
       at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:3116)
       at org.jboss.cache.TreeCache.get(TreeCache.java:1571)
       at org.jboss.cache.TreeCache.get(TreeCache.java:1555)
      


      My cache configuration is very simple and looks as follows:

      <server>
       <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
       <!-- Name of the eviction policy class. -->
       <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
       <!-- Specific eviction policy configurations. This is LRU -->
       <attribute name="EvictionPolicyConfig">
       <config>
       <attribute name="wakeUpIntervalSeconds">86400</attribute>
      
       <!-- Cache wide default -->
       <region name="/_default_">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToIdleSeconds">43200</attribute>
       </region>
      
       <region name="/a/b/c">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToIdleSeconds">0</attribute>
       </region>
      
       <region name="/a/b/d">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToIdleSeconds">0</attribute>
       </region>
      
       </config>
       </attribute>
       </mbean>
      </server>
      


      The application servers I have tested against are JBoss 4.0.2, Weblogic 8.3 and WebSphere 5.1.1, and it occurs on all platforms: AIX, Windows, Linux.

      I would really appreciate if anyone could provide some lead on the issue.

      Thanks
      -Yogesh