After working for a while I was able to come up with a JUnit test case that 
reproduces this.  The code is below.  I started with the 
org.jboss.cache.eviction.LRUPolicyTest class and added the following test:

  public void testForEvictionInternalError() {
  |     try {
  |       String rootStr = "/test/testdata";
  | 
  |       for (int i = 0; i < 10; i++) {
  |         String str = rootStr + i;
  |         Fqn fqn = Fqn.fromString(str);
  |         try {
  |           cache_.put(fqn, str, str);
  |         } catch (Exception e) {
  |           fail("Failed to insert data" + e);
  |           e.printStackTrace();
  |         }
  |       }
  | 
  |       // wait for an eviction
  |       _sleep(2 * wakeupIntervalMillis_ + 1000);
  | 
  |       String val = (String) cache_.get(rootStr + "3", rootStr + "3");
  |       assertNull("DataNode should be empty ", val);
  | 
  |       // reinsert the elements
  |       for (int i = 0; i < 10; i++) {
  |         String str = rootStr + i;
  |         Fqn fqn = Fqn.fromString(str);
  |         try {
  |           cache_.put(fqn, str, str);
  |         } catch (Exception e) {
  |           fail("Failed to insert data" + e);
  |           e.printStackTrace();
  |         }
  |       }
  | 
  |       // clear the root
  |       Fqn root = cache_.get("/").getFqn();
  |       cache_.remove(root);
  | 
  |       // wait for an eviction
  |       _sleep(2 * wakeupIntervalMillis_ + 1000);
  | 
  |       val = (String) cache_.get(rootStr + "3", rootStr + "3");
  |       assertNull("DataNode should be empty ", val);
  | 
  |     } catch (Exception e) {
  |       e.printStackTrace();
  |       fail("Failed to get" + e);
  |     }
  |   }

on almost all the executions I end up having the following log statement 
somewhere:

org.jboss.cache.eviction.EvictionException: internal error. Can't find fqn in 
nodeMap. fqn: /test
  |     at 
org.jboss.cache.eviction.LRUAlgorithm.removeFromQueue(LRUAlgorithm.java:215)
  |     at 
org.jboss.cache.eviction.LRUAlgorithm.processRemovedNodes(LRUAlgorithm.java:107)
  |     at 
org.jboss.cache.eviction.LRUAlgorithm.processQueues(LRUAlgorithm.java:80)
  |     at org.jboss.cache.eviction.LRUAlgorithm.process(LRUAlgorithm.java:53)
  |     at 
org.jboss.cache.eviction.EvictionTimerTask.run(EvictionTimerTask.java:37)
  |     at java.util.TimerThread.mainLoop(Timer.java:432)
  |     at java.util.TimerThread.run(Timer.java:382)

I did not figure out a way to ALWAYS get this message but it appears in the 
majority of runs.  Note that you need to actually look at the log to see it, 
the test itself always passes, so it is not sufficient to wait for a test to 
fail.

What I think is now happening is when you insert a node, wait until it gets 
evicted by the system, and then reinsert the same node and call 
cache.remove("/"), the log message appears after that.  (But I am not sure of 
all this)

Please let me know if this test produces this log warning for you as well.

Thank you,
Daniel

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3928317#3928317

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3928317


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to