From 7d0061884c9c23305c3850511bdc166e37be3fa4 Mon Sep 17 00:00:00 2001 From: gojomo Date: Sat, 5 Dec 2009 00:55:55 +0000 Subject: [PATCH] Prevent timing NPEs on CrawlLimitEnforcer-triggered crawl end * AbstractFrontier.java close recovery log in stop() (comes later, usu. from managerThread) rather than terminate() (earlier, may occur in other threads like progress-stats-snapshot thread) --- .../java/org/archive/crawler/frontier/AbstractFrontier.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/engine/src/main/java/org/archive/crawler/frontier/AbstractFrontier.java b/engine/src/main/java/org/archive/crawler/frontier/AbstractFrontier.java index 194f89ed..269574c4 100644 --- a/engine/src/main/java/org/archive/crawler/frontier/AbstractFrontier.java +++ b/engine/src/main/java/org/archive/crawler/frontier/AbstractFrontier.java @@ -170,6 +170,7 @@ public abstract class AbstractFrontier public void stop() { terminate(); + ArchiveUtils.closeQuietly(this.recover); } @@ -643,8 +644,6 @@ public abstract class AbstractFrontier synchronized public void terminate() { requestState(State.FINISH); - // TODO: move this recover-cleanup to manager thread? - ArchiveUtils.closeQuietly(this.recover); } /**