try to be more aggressive shutting down the search executor in the face of interruption

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1236748 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-01-27 16:40:49 +00:00
parent 6d1e24554a
commit 440a7991d3

View File

@ -732,8 +732,17 @@ public final class SolrCore implements SolrInfoMBean {
if (!searcherExecutor.awaitTermination(60, TimeUnit.SECONDS)) {
log.error("Timeout waiting for searchExecutor to terminate");
}
} catch (InterruptedException e) {
searcherExecutor.shutdownNow();
try {
if (!searcherExecutor.awaitTermination(30, TimeUnit.SECONDS)) {
log.error("Timeout waiting for searchExecutor to terminate");
}
} catch (InterruptedException e2) {
SolrException.log(log, e2);
}
} catch (Exception e) {
SolrException.log(log,e);
SolrException.log(log, e);
}
try {
// Since we waited for the searcherExecutor to shut down,
@ -744,7 +753,7 @@ public final class SolrCore implements SolrInfoMBean {
// then the searchExecutor will throw an exception when getSearcher()
// tries to use it, and the exception handling code should close it.
closeSearcher();
} catch (Exception e) {
} catch (Throwable e) {
SolrException.log(log,e);
}