fix for null pointer exception during shut-down

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1415 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 47843e69e2
commit eabf4a0386

@ -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");
}

@ -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 {

Loading…
Cancel
Save