Handle exceptions during reindexing
If an exception is thrown from within the change indexer, the reindex program shows a stack trace. In the case of an error when using the Solr index, it does not exit and continues running, while showing debug messages "Got ping response for sessionid", but not doing anything else. Catch exceptions in the indexer and exit with a fatal error message. Change-Id: Ief41eccc0d3fe9c5592782b51afa66c0c3150886
This commit is contained in:
@@ -143,11 +143,15 @@ public class Reindex extends SiteProgram {
|
||||
sysManager.start();
|
||||
|
||||
index = sysInjector.getInstance(IndexCollection.class).getSearchIndex();
|
||||
index.markReady(false);
|
||||
index.deleteAll();
|
||||
int result = indexAll();
|
||||
index.markReady(true);
|
||||
|
||||
int result = 0;
|
||||
try {
|
||||
index.markReady(false);
|
||||
index.deleteAll();
|
||||
result = indexAll();
|
||||
index.markReady(true);
|
||||
} catch (Exception e) {
|
||||
throw die(e.getMessage());
|
||||
}
|
||||
sysManager.stop();
|
||||
dbManager.stop();
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user