Skip to content

Commit

Permalink
loop detection and termination in deletedHandles method
Browse files Browse the repository at this point in the history
  • Loading branch information
orbiter committed Oct 12, 2006
1 parent 1c4076d commit 130cc76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/de/anomic/kelondro/kelondroRecords.java
Expand Up @@ -1049,6 +1049,11 @@ protected final Set deletedHandles(long maxTime) throws kelondroException, IOExc
Handle h = USAGE.FREEH;
while (h.index != NUL) {
//System.out.println("handle=0x" + Integer.toHexString(h.index));
if (markedDeleted.contains(h)) {
// loop detection
this.theLogger.severe("KELONDRO WARNING " + this.filename + ": FREE-Queue contains loops");
return markedDeleted;
}
markedDeleted.add(h);
seekp = seekpos(h);
if (seekp > entryFile.length()) throw new kelondroException("deletedHandles: seek position " + seekp + "/" + h.index + " out of file size " + entryFile.length() + "/" + ((entryFile.length() - POS_NODES) / recordsize));
Expand Down

0 comments on commit 130cc76

Please sign in to comment.