better debugging of balancer failure

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3478 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2007-03-14 12:02:56 +00:00
parent dd06d4cada
commit 81c4cc6bf7

View File

@ -388,6 +388,7 @@ public class plasmaCrawlNURL {
int s;
Entry entry;
kelondroRow.Entry re;
synchronized (stack) {
while ((s = stack.size()) > 0) {
re = stack.pop();
if (re == null) {
@ -408,6 +409,7 @@ public class plasmaCrawlNURL {
musicStackIndex.remove(entry.hash);
return entry;
}
}
throw new IOException("crawl stack is empty");
}
@ -416,6 +418,7 @@ public class plasmaCrawlNURL {
String hash;
int s;
Entry entry;
synchronized (balancer) {
while ((s = balancer.size()) > 0) {
hash = balancer.pop(minimumDelta, maximumDomAge);
if (hash == null) {
@ -426,16 +429,17 @@ public class plasmaCrawlNURL {
try {
entry = new Entry(hash);
} catch (IOException e) {
serverLog.logWarning("NURL", e.getMessage());
serverLog.logSevere("NURL", e.getMessage(), e);
if (s > balancer.size()) continue;
balancer.clear(); // the balancer is broken and cannot shrink
throw new IOException("hash is null, balancer cannot shrink; reset of balancer (2)");
throw new IOException("IO error, balancer cannot shrink: " + e.getMessage() + "; reset of balancer (2)");
}
imageStackIndex.remove(entry.hash);
movieStackIndex.remove(entry.hash);
musicStackIndex.remove(entry.hash);
return entry;
}
}
}
throw new IOException("balancer stack is empty");
}