Apache Solr open-source search software
SOLR-13030: Update executor usage to work correctly with Java 11 and update Mockito & HttpComponents to work with Java 11 and fix get remote info retry to work across jvms better.
markrmillerd8f482f5fbae
diff --git a/lucene/ivy-versions.properties b/lucene/ivy-versions.propertiesindex 5a4f7de08ae..2cfb65c0d83 100644--- a/lucene/ivy-versions.properties+++ b/lucene/ivy-versions.properties@@ -85,7 +85,7 @@ io.prometheus.version = 0.2.0/mecab/mecab-ko-dic = 2.0.3-20170922/mecab/mecab-naist-jdic = 0.6.3b-20111013/net.arnx/jsonic = 1.2.7-/net.bytebuddy/byte-buddy = 1.6.2+/net.bytebuddy/byte-buddy = 1.9.3/net.hydromatic/eigenbase-properties = 1.1.5/net.sf.ehcache/ehcache-core = 2.4.4@@ -165,9 +165,9 @@ org.apache.hadoop.version = 2.7.4# The httpcore version is often different from the httpclient and httpmime versions,# so the httpcore version value should not share the same symbolic name with them.-/org.apache.httpcomponents/httpclient = 4.5.3-/org.apache.httpcomponents/httpcore = 4.4.6-/org.apache.httpcomponents/httpmime = 4.5.3+/org.apache.httpcomponents/httpclient = 4.5.6+/org.apache.httpcomponents/httpcore = 4.4.10+/org.apache.httpcomponents/httpmime = 4.5.6/org.apache.ivy/ivy = 2.4.0@@ -244,7 +244,7 @@ org.codehaus.janino.version = 2.7.6/org.codehaus.woodstox/stax2-api = 3.1.4/org.codehaus.woodstox/woodstox-core-asl = 4.4.1-org.eclipse.jetty.version = 9.4.11.v20180605+org.eclipse.jetty.version = 9.4.14.v20181114/org.eclipse.jetty/jetty-continuation = ${org.eclipse.jetty.version}/org.eclipse.jetty/jetty-deploy = ${org.eclipse.jetty.version}/org.eclipse.jetty/jetty-http = ${org.eclipse.jetty.version}@@ -272,7 +272,7 @@ org.gagravarr.vorbis.java.version = 0.8/org.locationtech.jts/jts-core = 1.15.0/org.locationtech.spatial4j/spatial4j = 0.7-/org.mockito/mockito-core = 2.6.2+/org.mockito/mockito-core = 2.23.4org.mortbay.jetty.version = 6.1.26/org.mortbay.jetty/jetty = ${org.mortbay.jetty.version}@@ -280,7 +280,7 @@ org.mortbay.jetty.version = 6.1.26/org.mortbay.jetty/jetty-util = ${org.mortbay.jetty.version}/org.noggit/noggit = 0.8-/org.objenesis/objenesis = 2.5+/org.objenesis/objenesis = 2.6org.ow2.asm.version = 5.1/org.ow2.asm/asm = ${org.ow2.asm.version}diff --git a/lucene/licenses/httpclient-4.5.3.jar.sha1 b/lucene/licenses/httpclient-4.5.3.jar.sha1deleted file mode 100644index 415a080e3be..00000000000--- a/lucene/licenses/httpclient-4.5.3.jar.sha1+++ /dev/null@@ -1 +0,0 @@-d1577ae15f01ef5438c5afc62162457c00a34713diff --git a/lucene/licenses/httpclient-4.5.6.jar.sha1 b/lucene/licenses/httpclient-4.5.6.jar.sha1new file mode 100644index 00000000000..92b233e916a--- /dev/null+++ b/lucene/licenses/httpclient-4.5.6.jar.sha1@@ -0,0 +1 @@+1afe5621985efe90a92d0fbc9be86271efbe796fdiff --git a/lucene/licenses/httpcore-4.4.10.jar.sha1 b/lucene/licenses/httpcore-4.4.10.jar.sha1new file mode 100644index 00000000000..6f915469a6c--- /dev/null+++ b/lucene/licenses/httpcore-4.4.10.jar.sha1@@ -0,0 +1 @@+acc54d9b28bdffe4bbde89ed2e4a1e86b5285e2bdiff --git a/lucene/licenses/httpcore-4.4.6.jar.sha1 b/lucene/licenses/httpcore-4.4.6.jar.sha1deleted file mode 100644index 83cac99365f..00000000000--- a/lucene/licenses/httpcore-4.4.6.jar.sha1+++ /dev/null@@ -1 +0,0 @@-e3fd8ced1f52c7574af952e2e6da0df8df08eb82diff --git a/lucene/licenses/jetty-continuation-9.4.11.v20180605.jar.sha1 b/lucene/licenses/jetty-continuation-9.4.11.v20180605.jar.sha1deleted file mode 100644index 443533c7a03..00000000000--- a/lucene/licenses/jetty-continuation-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-31f1e347d013356317164b86bbbc2a6ce5c5e871diff --git a/lucene/licenses/jetty-continuation-9.4.14.v20181114.jar.sha1 b/lucene/licenses/jetty-continuation-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..0d9db3a3eb9--- /dev/null+++ b/lucene/licenses/jetty-continuation-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+ac4981a61bcaf4e2538de6270300a870224a16b8diff --git a/lucene/licenses/jetty-http-9.4.11.v20180605.jar.sha1 b/lucene/licenses/jetty-http-9.4.11.v20180605.jar.sha1deleted file mode 100644index 76a024c023a..00000000000--- a/lucene/licenses/jetty-http-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-20c35f5336befe35b0bd5c4a63e07170fe7872d7diff --git a/lucene/licenses/jetty-http-9.4.14.v20181114.jar.sha1 b/lucene/licenses/jetty-http-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..5e72e348a5f--- /dev/null+++ b/lucene/licenses/jetty-http-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+6d0c8ac42e9894ae7b5032438eb4579c2a47f4fediff --git a/lucene/licenses/jetty-io-9.4.11.v20180605.jar.sha1 b/lucene/licenses/jetty-io-9.4.11.v20180605.jar.sha1deleted file mode 100644index 38f084900fe..00000000000--- a/lucene/licenses/jetty-io-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-d164de1dac18c4ca80a1b783d879c97449909c3bdiff --git a/lucene/licenses/jetty-io-9.4.14.v20181114.jar.sha1 b/lucene/licenses/jetty-io-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..f3acf854462--- /dev/null+++ b/lucene/licenses/jetty-io-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+a8c6a705ddb9f83a75777d89b0be59fcef3f7637diff --git a/lucene/licenses/jetty-server-9.4.11.v20180605.jar.sha1 b/lucene/licenses/jetty-server-9.4.11.v20180605.jar.sha1deleted file mode 100644index 36e39e0d1b6..00000000000--- a/lucene/licenses/jetty-server-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-58353c2f27515b007fc83ae22002feb34fc24714diff --git a/lucene/licenses/jetty-server-9.4.14.v20181114.jar.sha1 b/lucene/licenses/jetty-server-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..182b5c5cc35--- /dev/null+++ b/lucene/licenses/jetty-server-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+b36a3d52d78a1df6406f6fa236a6eeff48cbfef6diff --git a/lucene/licenses/jetty-servlet-9.4.11.v20180605.jar.sha1 b/lucene/licenses/jetty-servlet-9.4.11.v20180605.jar.sha1deleted file mode 100644index e90c80c8702..00000000000--- a/lucene/licenses/jetty-servlet-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-66d31900fcfc70e3666f0b3335b6660635154f98diff --git a/lucene/licenses/jetty-servlet-9.4.14.v20181114.jar.sha1 b/lucene/licenses/jetty-servlet-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..d1576d3a1f2--- /dev/null+++ b/lucene/licenses/jetty-servlet-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+96f501462af425190ff7b63e387692c1aa3af2c8diff --git a/lucene/licenses/jetty-util-9.4.11.v20180605.jar.sha1 b/lucene/licenses/jetty-util-9.4.11.v20180605.jar.sha1deleted file mode 100644index 111b23070fb..00000000000--- a/lucene/licenses/jetty-util-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-f0f25aa2f27d618a04bc7356fa247ae4a05245b3diff --git a/lucene/licenses/jetty-util-9.4.14.v20181114.jar.sha1 b/lucene/licenses/jetty-util-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..ffced699946--- /dev/null+++ b/lucene/licenses/jetty-util-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+5bb3d7a38f7ea54138336591d89dd5867b806c02diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex e4fb80526e9..22b67212b97 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -26,7 +26,7 @@ Apache Tika 1.19.1Carrot2 3.16.0Velocity 1.7 and Velocity Tools 2.0Apache ZooKeeper 3.4.11-Jetty 9.4.11.v20180605+Jetty 9.4.14.v20181114Upgrade Notes----------------------@@ -119,7 +119,7 @@ Apache Tika 1.19.1Carrot2 3.16.0Velocity 1.7 and Velocity Tools 2.0Apache ZooKeeper 3.4.11-Jetty 9.4.11.v20180605+Jetty 9.4.14.v20181114Upgrade Notesdiff --git a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.javaindex c1d927ba504..5b5a0326da8 100644--- a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java+++ b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java@@ -28,6 +28,7 @@ import java.util.List;import java.util.Map;import java.util.Properties;import java.util.Random;+import java.util.concurrent.ExecutorService;import java.util.concurrent.TimeUnit;import java.util.concurrent.atomic.AtomicInteger;import java.util.concurrent.atomic.AtomicLong;@@ -46,6 +47,8 @@ import javax.servlet.http.HttpServletResponse;import org.apache.solr.client.solrj.SolrClient;import org.apache.solr.client.solrj.cloud.SocketProxy;import org.apache.solr.client.solrj.impl.HttpSolrClient;+import org.apache.solr.common.util.ExecutorUtil;+import org.apache.solr.common.util.SolrjNamedThreadFactory;import org.apache.solr.common.util.TimeSource;import org.apache.solr.core.CoreContainer;import org.apache.solr.servlet.SolrDispatchFilter;@@ -533,21 +536,23 @@ public class JettySolrRunner {// we want to shutdown outside of jetty cutting us offSolrDispatchFilter sdf = getSolrDispatchFilter();- Thread shutdownThead = null;+ ExecutorService customThreadPool = null;if (sdf != null) {- shutdownThead = new Thread() {-- public void run() {- try {- sdf.close();- } catch (Throwable t) {- log.error("Error shutting down Solr", t);- }- }+ customThreadPool = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("jettyShutDown"));- };sdf.closeOnDestroy(false);- shutdownThead.start();+// customThreadPool.submit(() -> {+// try {+// sdf.close();+// } catch (Throwable t) {+// log.error("Error shutting down Solr", t);+// }+// });+ try {+ sdf.close();+ } catch (Throwable t) {+ log.error("Error shutting down Solr", t);+ }}QueuedThreadPool qtp = (QueuedThreadPool) server.getThreadPool();@@ -588,8 +593,8 @@ public class JettySolrRunner {-> rte.isStopped());}- if (shutdownThead != null) {- shutdownThead.join();+ if (customThreadPool != null) {+ ExecutorUtil.shutdownAndAwaitTermination(customThreadPool);}do {diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.javaindex 32a030c88dc..b215048b4ce 100644--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java@@ -47,7 +47,6 @@ import java.util.concurrent.ConcurrentHashMap;import java.util.concurrent.CountDownLatch;import java.util.concurrent.ExecutionException;import java.util.concurrent.ExecutorService;-import java.util.concurrent.ForkJoinPool;import java.util.concurrent.Future;import java.util.concurrent.TimeUnit;import java.util.concurrent.TimeoutException;@@ -97,6 +96,7 @@ import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.util.ExecutorUtil;import org.apache.solr.common.util.IOUtils;import org.apache.solr.common.util.ObjectReleaseTracker;+import org.apache.solr.common.util.SolrjNamedThreadFactory;import org.apache.solr.common.util.StrUtils;import org.apache.solr.common.util.URLUtil;import org.apache.solr.common.util.Utils;@@ -568,7 +568,7 @@ public class ZkController implements Closeable {public void close() {this.isClosed = true;- ForkJoinPool customThreadPool = new ForkJoinPool(10);+ ExecutorService customThreadPool = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("closeThreadPool"));customThreadPool.submit(() -> Collections.singleton(overseerElector.getContext()).parallelStream().forEach(c -> {IOUtils.closeQuietly(c);diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.javaindex 04eb2c560af..1be03a81781 100644--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java@@ -51,7 +51,6 @@ import java.util.Properties;import java.util.concurrent.ConcurrentHashMap;import java.util.concurrent.ExecutionException;import java.util.concurrent.ExecutorService;-import java.util.concurrent.ForkJoinPool;import java.util.concurrent.Future;import org.apache.http.auth.AuthSchemeProvider;@@ -82,6 +81,7 @@ import org.apache.solr.common.cloud.Replica.State;import org.apache.solr.common.params.CollectionAdminParams;import org.apache.solr.common.util.ExecutorUtil;import org.apache.solr.common.util.IOUtils;+import org.apache.solr.common.util.SolrjNamedThreadFactory;import org.apache.solr.common.util.Utils;import org.apache.solr.core.DirectoryFactory.DirContext;import org.apache.solr.core.backup.repository.BackupRepository;@@ -828,7 +828,7 @@ public class CoreContainer {log.info("Shutting down CoreContainer instance="+ System.identityHashCode(this));- ForkJoinPool customThreadPool = new ForkJoinPool(6);+ ExecutorService customThreadPool = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("closeThreadPool"));isShutDown = true;try {@@ -890,9 +890,9 @@ public class CoreContainer {solrCores.getModifyLock().notifyAll(); // wake up the thread}- customThreadPool.submit(() -> Collections.singleton(replayUpdatesExecutor).parallelStream().forEach(c -> {- c.shutdownAndAwaitTermination();- }));+ customThreadPool.submit(() -> {+ replayUpdatesExecutor.shutdownAndAwaitTermination();+ });if (metricsHistoryHandler != null) {metricsHistoryHandler.close();@@ -919,9 +919,9 @@ public class CoreContainer {try {if (coreAdminHandler != null) {- customThreadPool.submit(() -> Collections.singleton(coreAdminHandler).parallelStream().forEach(c -> {- c.shutdown();- }));+ customThreadPool.submit(() -> {+ coreAdminHandler.shutdown();+ });}} catch (Exception e) {log.warn("Error shutting down CoreAdminHandler. Continuing to close CoreContainer.", e);@@ -930,9 +930,9 @@ public class CoreContainer {} finally {try {if (shardHandlerFactory != null) {- customThreadPool.submit(() -> Collections.singleton(shardHandlerFactory).parallelStream().forEach(c -> {- c.close();- }));+ customThreadPool.submit(() -> {+ shardHandlerFactory.close();+ });}} finally {try {diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.javaindex 0d9d441a7c0..708016e7734 100644--- a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java@@ -17,15 +17,14 @@package org.apache.solr.cloud;import static org.apache.solr.cloud.AbstractDistribZkTestBase.verifyReplicaStatus;+import static org.mockito.Mockito.anyBoolean;+import static org.mockito.Mockito.anyInt;+import static org.mockito.Mockito.anyString;import static org.mockito.Mockito.doNothing;import static org.mockito.Mockito.doReturn;import static org.mockito.Mockito.mock;import static org.mockito.Mockito.when;-import static org.mockito.Mockito.anyString;-import static org.mockito.Mockito.anyInt;-import static org.mockito.Mockito.anyBoolean;-import java.io.IOException;import java.lang.invoke.MethodHandles;import java.util.ArrayList;@@ -38,7 +37,7 @@ import java.util.Locale;import java.util.Map;import java.util.Optional;import java.util.Set;-import java.util.concurrent.ForkJoinPool;+import java.util.concurrent.ExecutorService;import java.util.concurrent.TimeUnit;import java.util.concurrent.TimeoutException;import java.util.concurrent.atomic.AtomicBoolean;@@ -48,6 +47,7 @@ import javax.xml.parsers.ParserConfigurationException;import org.apache.lucene.util.LuceneTestCase.Slow;import org.apache.solr.SolrTestCaseJ4;+import org.apache.solr.client.solrj.SolrClient;import org.apache.solr.client.solrj.cloud.DistributedQueue;import org.apache.solr.client.solrj.cloud.SolrCloudManager;import org.apache.solr.client.solrj.impl.CloudSolrClient;@@ -68,6 +68,7 @@ import org.apache.solr.common.cloud.ZkStateReader;import org.apache.solr.common.params.CollectionParams;import org.apache.solr.common.util.ExecutorUtil;import org.apache.solr.common.util.IOUtils;+import org.apache.solr.common.util.SolrjNamedThreadFactory;import org.apache.solr.common.util.TimeSource;import org.apache.solr.common.util.Utils;import org.apache.solr.core.CloudConfig;@@ -313,27 +314,41 @@ public class OverseerTest extends SolrTestCaseJ4 {public void tearDown() throws Exception {testDone = true;- ForkJoinPool customThreadPool = new ForkJoinPool(16);+ ExecutorService customThreadPool = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("closeThreadPool"));- customThreadPool.submit( () -> zkControllers.parallelStream().forEach(c -> { c.close(); }));-- customThreadPool.submit( () -> httpShardHandlerFactorys.parallelStream().forEach(c -> { c.close(); }));-- customThreadPool.submit( () -> updateShardHandlers.parallelStream().forEach(c -> { c.close(); }));-- customThreadPool.submit( () -> solrClients.parallelStream().forEach(c -> { IOUtils.closeQuietly(c); } ));+ for (ZkController zkController : zkControllers) {+ customThreadPool.submit( () -> zkController.close());+ }+ for (HttpShardHandlerFactory httpShardHandlerFactory : httpShardHandlerFactorys) {+ customThreadPool.submit( () -> httpShardHandlerFactory.close());+ }++ for (UpdateShardHandler updateShardHandler : updateShardHandlers) {+ customThreadPool.submit( () -> updateShardHandler.close());+ }- customThreadPool.submit( () -> readers.parallelStream().forEach(c -> { c.close();}));+ for (SolrClient solrClient : solrClients) {+ customThreadPool.submit( () -> IOUtils.closeQuietly(solrClient));+ }++ for (ZkStateReader reader : readers) {+ customThreadPool.submit( () -> reader.close());+ }- customThreadPool.submit( () -> zkClients.parallelStream().forEach(c -> { IOUtils.closeQuietly(c); }));+ for (SolrZkClient solrZkClient : zkClients) {+ customThreadPool.submit( () -> IOUtils.closeQuietly(solrZkClient));+ }ExecutorUtil.shutdownAndAwaitTermination(customThreadPool);- customThreadPool = new ForkJoinPool(4);-- customThreadPool.submit( () -> overseers.parallelStream().forEach(c -> { c.close(); }));+ customThreadPool = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("closeThreadPool"));++ for (Overseer overseer : overseers) {+ customThreadPool.submit( () -> overseer.close());+ }+ExecutorUtil.shutdownAndAwaitTermination(customThreadPool);overseers.clear();diff --git a/solr/licenses/byte-buddy-1.6.2.jar.sha1 b/solr/licenses/byte-buddy-1.6.2.jar.sha1deleted file mode 100644index af3a381da6f..00000000000--- a/solr/licenses/byte-buddy-1.6.2.jar.sha1+++ /dev/null@@ -1 +0,0 @@-f58a01d36e24a94241d44d52c78e380396d5adb2diff --git a/solr/licenses/byte-buddy-1.9.3.jar.sha1 b/solr/licenses/byte-buddy-1.9.3.jar.sha1new file mode 100644index 00000000000..2a02d426736--- /dev/null+++ b/solr/licenses/byte-buddy-1.9.3.jar.sha1@@ -0,0 +1 @@+f32e510b239620852fc9a2387fac41fd053d6a4ddiff --git a/solr/licenses/httpclient-4.5.3.jar.sha1 b/solr/licenses/httpclient-4.5.3.jar.sha1deleted file mode 100644index 415a080e3be..00000000000--- a/solr/licenses/httpclient-4.5.3.jar.sha1+++ /dev/null@@ -1 +0,0 @@-d1577ae15f01ef5438c5afc62162457c00a34713diff --git a/solr/licenses/httpclient-4.5.6.jar.sha1 b/solr/licenses/httpclient-4.5.6.jar.sha1new file mode 100644index 00000000000..92b233e916a--- /dev/null+++ b/solr/licenses/httpclient-4.5.6.jar.sha1@@ -0,0 +1 @@+1afe5621985efe90a92d0fbc9be86271efbe796fdiff --git a/solr/licenses/httpcore-4.4.10.jar.sha1 b/solr/licenses/httpcore-4.4.10.jar.sha1new file mode 100644index 00000000000..6f915469a6c--- /dev/null+++ b/solr/licenses/httpcore-4.4.10.jar.sha1@@ -0,0 +1 @@+acc54d9b28bdffe4bbde89ed2e4a1e86b5285e2bdiff --git a/solr/licenses/httpcore-4.4.6.jar.sha1 b/solr/licenses/httpcore-4.4.6.jar.sha1deleted file mode 100644index 83cac99365f..00000000000--- a/solr/licenses/httpcore-4.4.6.jar.sha1+++ /dev/null@@ -1 +0,0 @@-e3fd8ced1f52c7574af952e2e6da0df8df08eb82diff --git a/solr/licenses/httpmime-4.5.3.jar.sha1 b/solr/licenses/httpmime-4.5.3.jar.sha1deleted file mode 100644index 754ef5471cb..00000000000--- a/solr/licenses/httpmime-4.5.3.jar.sha1+++ /dev/null@@ -1 +0,0 @@-889fd6d061bb63b99dd5c6aba35a555ae863de52diff --git a/solr/licenses/httpmime-4.5.6.jar.sha1 b/solr/licenses/httpmime-4.5.6.jar.sha1new file mode 100644index 00000000000..eba7d66ef2c--- /dev/null+++ b/solr/licenses/httpmime-4.5.6.jar.sha1@@ -0,0 +1 @@+164343da11db817e81e24e0d9869527e069850c9diff --git a/solr/licenses/jetty-continuation-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-continuation-9.4.11.v20180605.jar.sha1deleted file mode 100644index 443533c7a03..00000000000--- a/solr/licenses/jetty-continuation-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-31f1e347d013356317164b86bbbc2a6ce5c5e871diff --git a/solr/licenses/jetty-continuation-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-continuation-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..0d9db3a3eb9--- /dev/null+++ b/solr/licenses/jetty-continuation-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+ac4981a61bcaf4e2538de6270300a870224a16b8diff --git a/solr/licenses/jetty-deploy-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-deploy-9.4.11.v20180605.jar.sha1deleted file mode 100644index e986062edb4..00000000000--- a/solr/licenses/jetty-deploy-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-0a65a7944d79bef225bb4431e13e6dbec4077aa5diff --git a/solr/licenses/jetty-deploy-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-deploy-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..bdc13e2b769--- /dev/null+++ b/solr/licenses/jetty-deploy-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+db0e01f00c1d11fbf2dfa72a1707b7ac9859c943diff --git a/solr/licenses/jetty-http-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-http-9.4.11.v20180605.jar.sha1deleted file mode 100644index 76a024c023a..00000000000--- a/solr/licenses/jetty-http-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-20c35f5336befe35b0bd5c4a63e07170fe7872d7diff --git a/solr/licenses/jetty-http-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-http-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..5e72e348a5f--- /dev/null+++ b/solr/licenses/jetty-http-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+6d0c8ac42e9894ae7b5032438eb4579c2a47f4fediff --git a/solr/licenses/jetty-io-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-io-9.4.11.v20180605.jar.sha1deleted file mode 100644index 38f084900fe..00000000000--- a/solr/licenses/jetty-io-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-d164de1dac18c4ca80a1b783d879c97449909c3bdiff --git a/solr/licenses/jetty-io-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-io-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..f3acf854462--- /dev/null+++ b/solr/licenses/jetty-io-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+a8c6a705ddb9f83a75777d89b0be59fcef3f7637diff --git a/solr/licenses/jetty-jmx-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-jmx-9.4.11.v20180605.jar.sha1deleted file mode 100644index f2aaf1ab151..00000000000--- a/solr/licenses/jetty-jmx-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-f942e96b0c96cc4d84349a6deee60ddfb38f7f11diff --git a/solr/licenses/jetty-jmx-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-jmx-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..44b8ffcff36--- /dev/null+++ b/solr/licenses/jetty-jmx-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+3e02463d2bff175a3231cd3dc26363eaf76a3b17diff --git a/solr/licenses/jetty-rewrite-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-rewrite-9.4.11.v20180605.jar.sha1deleted file mode 100644index 4474cea3210..00000000000--- a/solr/licenses/jetty-rewrite-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-5d9bb01166931ef6704f0c277e02bab0c35c04d7diff --git a/solr/licenses/jetty-rewrite-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-rewrite-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..636b338b840--- /dev/null+++ b/solr/licenses/jetty-rewrite-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+eb300aa639175741839b25a5109772bcc71a586adiff --git a/solr/licenses/jetty-security-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-security-9.4.11.v20180605.jar.sha1deleted file mode 100644index fb1fbcf07ca..00000000000--- a/solr/licenses/jetty-security-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-926def86d31ee07ca4b4658833dc6ee6918b8e86diff --git a/solr/licenses/jetty-security-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-security-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..64e092033a6--- /dev/null+++ b/solr/licenses/jetty-security-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+6cbeb2fe9b3cc4f88a7ea040b8a0c4f703cd72cediff --git a/solr/licenses/jetty-server-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-server-9.4.11.v20180605.jar.sha1deleted file mode 100644index 36e39e0d1b6..00000000000--- a/solr/licenses/jetty-server-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-58353c2f27515b007fc83ae22002feb34fc24714diff --git a/solr/licenses/jetty-server-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-server-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..182b5c5cc35--- /dev/null+++ b/solr/licenses/jetty-server-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+b36a3d52d78a1df6406f6fa236a6eeff48cbfef6diff --git a/solr/licenses/jetty-servlet-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-servlet-9.4.11.v20180605.jar.sha1deleted file mode 100644index e90c80c8702..00000000000--- a/solr/licenses/jetty-servlet-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-66d31900fcfc70e3666f0b3335b6660635154f98diff --git a/solr/licenses/jetty-servlet-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-servlet-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..d1576d3a1f2--- /dev/null+++ b/solr/licenses/jetty-servlet-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+96f501462af425190ff7b63e387692c1aa3af2c8diff --git a/solr/licenses/jetty-servlets-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-servlets-9.4.11.v20180605.jar.sha1deleted file mode 100644index cdcc00aa55f..00000000000--- a/solr/licenses/jetty-servlets-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-8301f94a8b8e4a8ed7c065984b18c02c4206b920diff --git a/solr/licenses/jetty-servlets-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-servlets-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..7fec6af68fe--- /dev/null+++ b/solr/licenses/jetty-servlets-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+38cfc07b53e5d285bb2fca78bb2531565ed9c9e5diff --git a/solr/licenses/jetty-util-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-util-9.4.11.v20180605.jar.sha1deleted file mode 100644index 111b23070fb..00000000000--- a/solr/licenses/jetty-util-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-f0f25aa2f27d618a04bc7356fa247ae4a05245b3diff --git a/solr/licenses/jetty-util-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-util-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..ffced699946--- /dev/null+++ b/solr/licenses/jetty-util-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+5bb3d7a38f7ea54138336591d89dd5867b806c02diff --git a/solr/licenses/jetty-webapp-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-webapp-9.4.11.v20180605.jar.sha1deleted file mode 100644index 9f89760e71b..00000000000--- a/solr/licenses/jetty-webapp-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-5ce28eff8338cab2a0af0e583c769567542b9558diff --git a/solr/licenses/jetty-webapp-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-webapp-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..1e774f36c9a--- /dev/null+++ b/solr/licenses/jetty-webapp-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+0088a04172b5e7736bc3e95eb58623aa9ccdb475diff --git a/solr/licenses/jetty-xml-9.4.11.v20180605.jar.sha1 b/solr/licenses/jetty-xml-9.4.11.v20180605.jar.sha1deleted file mode 100644index 25c722e4adb..00000000000--- a/solr/licenses/jetty-xml-9.4.11.v20180605.jar.sha1+++ /dev/null@@ -1 +0,0 @@-883cbf629ec797bd9d8833376a0feec461628f4fdiff --git a/solr/licenses/jetty-xml-9.4.14.v20181114.jar.sha1 b/solr/licenses/jetty-xml-9.4.14.v20181114.jar.sha1new file mode 100644index 00000000000..ee136319bbd--- /dev/null+++ b/solr/licenses/jetty-xml-9.4.14.v20181114.jar.sha1@@ -0,0 +1 @@+65cd197bc8082a1007130c8b644cea7938133568diff --git a/solr/licenses/mockito-core-2.23.4.jar.sha1 b/solr/licenses/mockito-core-2.23.4.jar.sha1new file mode 100644index 00000000000..725998b2f35--- /dev/null+++ b/solr/licenses/mockito-core-2.23.4.jar.sha1@@ -0,0 +1 @@+a35b6f8ffcfa786771eac7d7d903429e790fdf3fdiff --git a/solr/licenses/mockito-core-2.6.2.jar.sha1 b/solr/licenses/mockito-core-2.6.2.jar.sha1deleted file mode 100644index f130b90bbfd..00000000000--- a/solr/licenses/mockito-core-2.6.2.jar.sha1+++ /dev/null@@ -1 +0,0 @@-9eeaa7c2a971cd4738e1b9391a38ba4f21f05763diff --git a/solr/licenses/objenesis-2.5.jar.sha1 b/solr/licenses/objenesis-2.5.jar.sha1deleted file mode 100644index f7f506d85a8..00000000000--- a/solr/licenses/objenesis-2.5.jar.sha1+++ /dev/null@@ -1 +0,0 @@-612ecb799912ccf77cba9b3ed8c813da086076e9diff --git a/solr/licenses/objenesis-2.6.jar.sha1 b/solr/licenses/objenesis-2.6.jar.sha1new file mode 100644index 00000000000..277e036b108--- /dev/null+++ b/solr/licenses/objenesis-2.6.jar.sha1@@ -0,0 +1 @@+639033469776fd37c08358c6b92a4761feb2af4bdiff --git a/solr/licenses/start.jar.sha1 b/solr/licenses/start.jar.sha1index 5583f364d79..b350925d356 100644--- a/solr/licenses/start.jar.sha1+++ b/solr/licenses/start.jar.sha1@@ -1 +1 @@-f7c30f1b8fba70569d65dcb353b542e5d2d220ec+ed9434016612e1e2c29b4db88bc5fdfe7dbcec2fdiff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.javaindex ff53f517c53..1a26451ff7f 100644--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java@@ -836,6 +836,7 @@ public class ZkStateReader implements Closeable {public void close() {this.closed = true;+notifications.shutdownNow();waitLatches.parallelStream().forEach(c -> { c.countDown(); });diff --git a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.javaindex 79a1f7a556c..4728aa384c7 100644--- a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java+++ b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java@@ -39,7 +39,6 @@ import java.util.Set;import java.util.SortedMap;import java.util.concurrent.ConcurrentHashMap;import java.util.concurrent.ExecutorService;-import java.util.concurrent.ForkJoinPool;import java.util.concurrent.SynchronousQueue;import java.util.concurrent.TimeUnit;import java.util.concurrent.atomic.AtomicInteger;@@ -66,6 +65,7 @@ import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.util.ExecutorUtil;import org.apache.solr.common.util.IOUtils;import org.apache.solr.common.util.NamedList;+import org.apache.solr.common.util.SolrjNamedThreadFactory;import org.apache.solr.util.DefaultSolrThreadFactory;import org.eclipse.jetty.servlet.ServletHolder;import org.junit.AfterClass;@@ -398,33 +398,35 @@ public abstract class BaseDistributedSearchTestCase extends SolrTestCaseJ4 {}protected void destroyServers() throws Exception {- ForkJoinPool customThreadPool = new ForkJoinPool(12);+ ExecutorService customThreadPool = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("closeThreadPool"));customThreadPool.submit(() -> Collections.singleton(controlClient).parallelStream().forEach(c -> {IOUtils.closeQuietly(c);}));- customThreadPool.submit(() -> Collections.singleton(controlJetty).parallelStream().forEach(c -> {+ customThreadPool.submit(() -> {try {- c.stop();+ controlJetty.stop();} catch (NullPointerException e) {// ignore} catch (Exception e) {log.error("Error stopping Control Jetty", e);}- }));-- customThreadPool.submit(() -> clients.parallelStream().forEach(c -> {- IOUtils.closeQuietly(c);- }));+ });- customThreadPool.submit(() -> jettys.parallelStream().forEach(c -> {- try {- c.stop();- } catch (Exception e) {- log.error("Error stopping Jetty", e);- }- }));+ for (SolrClient client : clients) {+ customThreadPool.submit(() -> IOUtils.closeQuietly(client));+ }++ for (JettySolrRunner jetty : jettys) {+ customThreadPool.submit(() -> {+ try {+ jetty.stop();+ } catch (Exception e) {+ log.error("Error stopping Jetty", e);+ }+ });+ }ExecutorUtil.shutdownAndAwaitTermination(customThreadPool);diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.javaindex 2fdb4b195c9..7df3345c15c 100644--- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java+++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java@@ -37,7 +37,7 @@ import java.util.Properties;import java.util.Random;import java.util.Set;import java.util.concurrent.ConcurrentHashMap;-import java.util.concurrent.ForkJoinPool;+import java.util.concurrent.ExecutorService;import java.util.concurrent.TimeUnit;import java.util.concurrent.TimeoutException;import java.util.concurrent.atomic.AtomicInteger;@@ -82,6 +82,7 @@ import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.util.ExecutorUtil;import org.apache.solr.common.util.IOUtils;import org.apache.solr.common.util.NamedList;+import org.apache.solr.common.util.SolrjNamedThreadFactory;import org.apache.solr.common.util.StrUtils;import org.apache.solr.common.util.TimeSource;import org.apache.solr.common.util.Utils;@@ -406,7 +407,7 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTescloudClient.waitForState(DEFAULT_COLLECTION, 30, TimeUnit.SECONDS, (l,c) -> c != null && c.getSlices().size() == sliceCount);- ForkJoinPool customThreadPool = new ForkJoinPool(12);+ ExecutorService customThreadPool = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("closeThreadPool"));int numOtherReplicas = numJettys - getPullReplicaCount() * sliceCount;@@ -426,7 +427,7 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTesnumOtherReplicas--;if (useTlogReplicas()) {log.info("create jetty {} in directory {} of type {} in shard {}", i, jettyDir, Replica.Type.TLOG, ((currentI % sliceCount) + 1));- customThreadPool.submit(() -> Collections.singleton(controlClient).parallelStream().forEach(c -> {+ customThreadPool.submit(() -> {try {JettySolrRunner j = createJetty(jettyDir, useJettyDataDir ? getDataDir(testDir + "/jetty"+ cnt) : null, null, "solrconfig.xml", null, Replica.Type.TLOG);@@ -444,17 +445,19 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTesclients.add(client);} catch (IOException e) {+ e.printStackTrace();throw new RuntimeException(e);} catch (Exception e) {+ e.printStackTrace();throw new RuntimeException(e);}- }));+ });addedReplicas++;} else {log.info("create jetty {} in directory {} of type {}", i, jettyDir, Replica.Type.NRT, ((currentI % sliceCount) + 1));- customThreadPool.submit(() -> Collections.singleton(controlClient).parallelStream().forEach(c -> {+ customThreadPool.submit(() -> {try {JettySolrRunner j = createJetty(jettyDir, useJettyDataDir ? getDataDir(testDir + "/jetty"+ cnt) : null, null, "solrconfig.xml", null, null);@@ -469,17 +472,19 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTesSolrClient client = createNewSolrClient(j.getLocalPort());clients.add(client);} catch (IOException e) {+ e.printStackTrace();throw new RuntimeException(e);} catch (Exception e) {+ e.printStackTrace();throw new RuntimeException(e);}- }));+ });addedReplicas++;}} else {log.info("create jetty {} in directory {} of type {}", i, jettyDir, Replica.Type.PULL, ((currentI % sliceCount) + 1));- customThreadPool.submit(() -> Collections.singleton(controlClient).parallelStream().forEach(c -> {+ customThreadPool.submit(() -> {try {JettySolrRunner j = createJetty(jettyDir, useJettyDataDir ? getDataDir(testDir + "/jetty"+ cnt) : null, null, "solrconfig.xml", null, Replica.Type.PULL);@@ -494,11 +499,13 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTesSolrClient client = createNewSolrClient(j.getLocalPort());clients.add(client);} catch (IOException e) {+ e.printStackTrace();throw new RuntimeException(e);} catch (Exception e) {+ e.printStackTrace();throw new RuntimeException(e);}- }));+ });addedReplicas++;}@@ -506,33 +513,39 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTesExecutorUtil.shutdownAndAwaitTermination(customThreadPool);- customThreadPool = new ForkJoinPool(12);- customThreadPool.submit(() -> createReplicaRequests.parallelStream().forEach(r -> {- CollectionAdminResponse response;- try {- response = (CollectionAdminResponse) r.process(cloudClient);- } catch (SolrServerException | IOException e) {- throw new RuntimeException(e);- }+ customThreadPool = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("createReplicaRequests"));++ for (CollectionAdminRequest r : createReplicaRequests) {+ customThreadPool.submit(() -> {+ CollectionAdminResponse response;+ try {+ response = (CollectionAdminResponse) r.process(cloudClient);+ } catch (SolrServerException | IOException e) {+ throw new RuntimeException(e);+ }- assertTrue(response.isSuccess());- String coreName = response.getCollectionCoresStatus().keySet().iterator().next();- }));+ assertTrue(response.isSuccess());+ String coreName = response.getCollectionCoresStatus().keySet().iterator().next();+ });+ }ExecutorUtil.shutdownAndAwaitTermination(customThreadPool);- customThreadPool = new ForkJoinPool(12);- customThreadPool.submit(() -> createPullReplicaRequests.parallelStream().forEach(r -> {- CollectionAdminResponse response;- try {- response = (CollectionAdminResponse) r.process(cloudClient);- } catch (SolrServerException | IOException e) {- throw new RuntimeException(e);- }+ customThreadPool = ExecutorUtil+ .newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("createPullReplicaRequests"));+ for (CollectionAdminRequest r : createPullReplicaRequests) {+ customThreadPool.submit(() -> {+ CollectionAdminResponse response;+ try {+ response = (CollectionAdminResponse) r.process(cloudClient);+ } catch (SolrServerException | IOException e) {+ throw new RuntimeException(e);+ }- assertTrue(response.isSuccess());- String coreName = response.getCollectionCoresStatus().keySet().iterator().next();- }));+ assertTrue(response.isSuccess());+ String coreName = response.getCollectionCoresStatus().keySet().iterator().next();+ });+ }ExecutorUtil.shutdownAndAwaitTermination(customThreadPool);@@ -1654,7 +1667,7 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes@Overrideprotected void destroyServers() throws Exception {- ForkJoinPool customThreadPool = new ForkJoinPool(6);+ ExecutorService customThreadPool = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("closeThreadPool"));customThreadPool.submit(() -> Collections.singleton(commonCloudSolrClient).parallelStream().forEach(c -> {IOUtils.closeQuietly(c);