Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

loop detection and termination in deletedHandles method see also: http://www.yacy-forum.de/viewtopic.php?p=26655#26655

orbiter130cc76927c2
diff --git a/source/de/anomic/kelondro/kelondroRecords.java b/source/de/anomic/kelondro/kelondroRecords.java
index 0ed8a0d2f..41ae99c5f 100644
--- a/source/de/anomic/kelondro/kelondroRecords.java
+++ b/source/de/anomic/kelondro/kelondroRecords.java
@@ -1049,6 +1049,11 @@ public class kelondroRecords {
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));