From 81c4cc6bf7bc40500b18733568d80fb38be80786 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 14 Mar 2007 12:02:56 +0000 Subject: [PATCH] better debugging of balancer failure git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3478 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaCrawlNURL.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/de/anomic/plasma/plasmaCrawlNURL.java b/source/de/anomic/plasma/plasmaCrawlNURL.java index 853702436..e12a90e83 100644 --- a/source/de/anomic/plasma/plasmaCrawlNURL.java +++ b/source/de/anomic/plasma/plasmaCrawlNURL.java @@ -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"); }