Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix for null pointer exception during shut-down

orbitereabf4a03865a
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index f0c4b4abc..1e6281443 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -768,7 +768,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
public void close() {
log.logConfig("SWITCHBOARD SHUTDOWN STEP 1: sending termination signal to managed threads:");
terminateAllThreads(true);
- log.logConfig("SWITCHBOARD SHUTDOWN STEP 2: sending termination signal to database manager");
+ log.logConfig("SWITCHBOARD SHUTDOWN STEP 2: sending termination signal to threaded indexing");
// closing all still running db importer jobs
plasmaDbImporter.close();
indexDistribution.close();
@@ -779,15 +779,15 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
messageDB.close();
if (facilityDB != null) try {facilityDB.close();} catch (IOException e) {}
sbStackCrawlThread.close();
- urlPool.close();
profiles.close();
robots.close();
parser.close();
cacheManager.close();
sbQueue.close();
flushCitationReference(crg, "crg");
- log.logConfig("SWITCHBOARD SHUTDOWN STEP 3: sending termination signal to threaded indexing (stand by...)");
+ log.logConfig("SWITCHBOARD SHUTDOWN STEP 3: sending termination signal to database manager (stand by...)");
int waitingBoundSeconds = Integer.parseInt(getConfig("maxWaitingWordFlush", "120"));
+ urlPool.close();
wordIndex.close(waitingBoundSeconds);
log.logConfig("SWITCHBOARD SHUTDOWN TERMINATED");
}
diff --git a/source/de/anomic/plasma/plasmaWordIndexCache.java b/source/de/anomic/plasma/plasmaWordIndexCache.java
index a0e032519..d8bfe6598 100644
--- a/source/de/anomic/plasma/plasmaWordIndexCache.java
+++ b/source/de/anomic/plasma/plasmaWordIndexCache.java
@@ -498,15 +498,17 @@ public final class plasmaWordIndexCache implements plasmaWordIndexInterface {
public void close(int waitingSeconds) {
// stop permanent flushing
flushThread.terminate();
- try {flushThread.join(5000);} catch (InterruptedException e) {}
+ try {flushThread.join(6000);} catch (InterruptedException e) {}
- // close cluster
- assortmentCluster.close();
+ // dump cache
try {
dump(waitingSeconds);
} catch (IOException e){
log.logSevere("unable to dump cache: " + e.getMessage(), e);
}
+
+ // close cluster
+ assortmentCluster.close();
}
public Object migrateWords2Assortment(String wordhash) throws IOException {