Skip to content

Commit

Permalink
fix for null pointer exception during shut-down
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1415 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Jan 23, 2006
1 parent 47843e6 commit eabf4a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions source/de/anomic/plasma/plasmaSwitchboard.java
Expand Up @@ -768,7 +768,7 @@ public int htEntrySize() {
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();
Expand All @@ -779,15 +779,15 @@ public void close() {
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");
}
Expand Down
8 changes: 5 additions & 3 deletions source/de/anomic/plasma/plasmaWordIndexCache.java
Expand Up @@ -498,15 +498,17 @@ private void addEntry(String wordHash, plasmaWordIndexEntry newEntry, long updat
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 {
Expand Down

0 comments on commit eabf4a0

Please sign in to comment.