From ab7a911bb31c7153b70eeadf59eb7254d40784bd Mon Sep 17 00:00:00 2001 From: theli Date: Sun, 29 Jan 2006 08:54:19 +0000 Subject: [PATCH] *) Trying to solve pool not open problem See: http://www.yacy-forum.de/viewtopic.php?t=1798 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1482 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../de/anomic/plasma/plasmaCrawlStacker.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/source/de/anomic/plasma/plasmaCrawlStacker.java b/source/de/anomic/plasma/plasmaCrawlStacker.java index fe7f0f422..ec33a2e3e 100644 --- a/source/de/anomic/plasma/plasmaCrawlStacker.java +++ b/source/de/anomic/plasma/plasmaCrawlStacker.java @@ -152,19 +152,26 @@ public final class plasmaCrawlStacker { public void job() { try { // getting a new message from the crawler queue + if (Thread.currentThread().isInterrupted()) return; stackCrawlMessage theMsg = this.queue.waitForMessage(); // getting a free session thread from the pool + if (Thread.currentThread().isInterrupted()) return; Worker worker = (Worker) this.theWorkerPool.borrowObject(); // processing the new request worker.execute(theMsg); - } catch (InterruptedException e) { - Thread.interrupted(); - //this.stopped = true; - } - catch (Exception e) { - this.log.logSevere("plasmaStackCrawlThread.run/loop", e); + } catch (Exception e) { + if (e instanceof InterruptedException) { + this.log.logFine("Interruption detected."); + } else if ((e instanceof IllegalStateException) && + (e.getMessage() != null) && + (e.getMessage().indexOf("Pool not open") >= -1)) { + this.log.logFine("Pool was closed."); + + } else { + this.log.logSevere("plasmaStackCrawlThread.run/loop", e); + } } }