[infinispan-issues] [JBoss JIRA] Commented: (ISPN-1213) TreeCache expires parents that have children
Todd Ciezadlo (JIRA)
jira-events at lists.jboss.org
Tue Jul 5 14:02:23 EDT 2011
[ https://issues.jboss.org/browse/ISPN-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612496#comment-12612496 ]
Todd Ciezadlo commented on ISPN-1213:
-------------------------------------
A work-around is to climb the parents and call Node.getNode(FQN) on each one instead of Node.get(String,String) or Node.get(Fqn,String).
Example replacement method (generic K replaced with String):
/**
* Gets the value for the given FQN and key.
* <p>
* Traverses the parents of the given FQN to reset their idle times.
*
* @param fqn the FQN
* @param key the key
* @return value of the FQN and key; or null if non-existent
*/
private static Object getAndTouchParents(TreeCache cache, String fqn, String key) {
Object value = null;
Node<Object, Object> node = cache.getNode(fqn);
if (node != null) {
value = node.get(key);
Fqn parentFqn;
do {
Node<Object, Object> parent = node.getParent();
parentFqn = parent.getFqn();
if (parentFqn != null) {
cache.getNode(parentFqn); // touch the parent to reset the idle time
}
} while (parentFqn != null && !parentFqn.isRoot());
}
return value;
}
> TreeCache expires parents that have children
> --------------------------------------------
>
> Key: ISPN-1213
> URL: https://issues.jboss.org/browse/ISPN-1213
> Project: Infinispan
> Issue Type: Bug
> Components: Eviction
> Affects Versions: 4.2.1.FINAL
> Reporter: Todd Ciezadlo
> Assignee: Manik Surtani
> Fix For: 5.0.0.FINAL
>
> Attachments: ExpirationTest.java
>
>
> TreeCache parents expire according to the max-idle value even if they contain children. This puts the tree cache in an inconsistent state since the "dangling" children can be retrieved through TreeCache.get(FQN, String) calls, but cannot be traversed to through TreeCache.getRoot() and Node.getChildren() calls.
> Attached unit test to to reproduce.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list