SOLR-5884: Name executor threads and use execturo shutdown rather than shutdownNow.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1580739 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2014-03-24 04:51:53 +00:00
parent 98017a31b3
commit 7422c1e1ee
1 changed files with 3 additions and 2 deletions

View File

@ -73,6 +73,7 @@ import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.SolrParams; import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.ContentStream; import org.apache.solr.common.util.ContentStream;
import org.apache.solr.common.util.NamedList; import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SolrjNamedThreadFactory;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -234,7 +235,7 @@ public class HttpSolrServer extends SolrServer {
public HttpUriRequestResponse httpUriRequest(final SolrRequest request, final ResponseParser processor) throws SolrServerException, IOException { public HttpUriRequestResponse httpUriRequest(final SolrRequest request, final ResponseParser processor) throws SolrServerException, IOException {
HttpUriRequestResponse mrr = new HttpUriRequestResponse(); HttpUriRequestResponse mrr = new HttpUriRequestResponse();
final HttpRequestBase method = createMethod(request); final HttpRequestBase method = createMethod(request);
ExecutorService pool = Executors.newFixedThreadPool(1); ExecutorService pool = Executors.newFixedThreadPool(1, new SolrjNamedThreadFactory("httpUriRequest"));
try { try {
mrr.future = pool.submit(new Callable<NamedList<Object>>(){ mrr.future = pool.submit(new Callable<NamedList<Object>>(){
@ -244,7 +245,7 @@ public class HttpSolrServer extends SolrServer {
}}); }});
} finally { } finally {
pool.shutdownNow(); pool.shutdown();
} }
assert method != null; assert method != null;
mrr.httpUriRequest = method; mrr.httpUriRequest = method;