From df6d417c4433195665d4dcdfd9a770a3ce0e51eb Mon Sep 17 00:00:00 2001 From: Anshum Gupta Date: Fri, 6 Jun 2014 23:44:43 +0000 Subject: [PATCH] SOLR-6148: Trying to fix Jenkins failures by not LazyLoading the ParallelExecutor in CoreAdminHandler git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1601038 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/handler/admin/CoreAdminHandler.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java index 61e51e7f8d1..a93a44ecb44 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java @@ -119,6 +119,8 @@ public class CoreAdminHandler extends RequestHandlerBase { // Unlike most request handlers, CoreContainer initialization // should happen in the constructor... this.coreContainer = null; + this.parallelExecutor = Executors.newFixedThreadPool(50, + new DefaultSolrThreadFactory("parallelCoreAdminExecutor")); } @@ -129,6 +131,8 @@ public class CoreAdminHandler extends RequestHandlerBase { */ public CoreAdminHandler(final CoreContainer coreContainer) { this.coreContainer = coreContainer; + this.parallelExecutor = Executors.newFixedThreadPool(50, + new DefaultSolrThreadFactory("parallelCoreAdminExecutor")); } @@ -186,10 +190,7 @@ public class CoreAdminHandler extends RequestHandlerBase { handleRequestInternal(req, rsp, action); } else { ParallelCoreAdminHandlerThread parallelHandlerThread = new ParallelCoreAdminHandlerThread(req, rsp, action, taskObject); - if(parallelExecutor == null || parallelExecutor.isShutdown()) - parallelExecutor = Executors.newFixedThreadPool(50, - new DefaultSolrThreadFactory("parallelCoreAdminExecutor")); - parallelExecutor.execute(parallelHandlerThread); + parallelExecutor.execute(parallelHandlerThread); } }