]
RH Bugzilla Integration commented on ISPN-5104:
-----------------------------------------------
Dave Stahl <dstahl(a)redhat.com> changed the Status of [bug
Infinite loop in TransactionAwareCloseableIterator when iterating
through cache...
----------------------------------------------------------------------------------
Key: ISPN-5104
URL:
https://issues.jboss.org/browse/ISPN-5104
Project: Infinispan
Issue Type: Bug
Components: Transactions
Affects Versions: 7.0.2.Final
Reporter: Christian Niessner
Assignee: William Burns
Fix For: 7.1.0.Beta1, 7.0.3.Final
Hi,
i have some testing code that iterates through a cache and validates all data in this
cache for consistency.
The reduced code is:
TransactionManager tm = cache.getAdvancedCache().getTransactionManager();
tm.begin();
try {
for (Entry<Object,Object> entry : metadataCache.entrySet()) {
// validation code omitted...
}
} finally {
tm.commit();
}
In some circumstances the iteration starts returning the same Entry every time. I stepped
into the code and the value is returned from:
https://github.com/infinispan/infinispan/blob/master/core/src/main/java/o...
This code block is commented with:
"// We do a last check to make sure no additional values were added to our context
while iterating"
And for me it seems that the value returned here never gets added to the
"seenContextKeys" Set and so the iterator is always returning the same key.
Maybe a simple "seenContextKeys.add(lookedUpEntry.getKey())" next to Line 70
would fix this issue. Maybe even a 'break' could make sense here because is there
the need to walk through the entire list if we have found a candidate?