better debugging of balancer failure

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3478 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent dd06d4cada
commit 81c4cc6bf7

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

Loading…
Cancel
Save