diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 1762101b9f3..237a172556b 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -150,6 +150,9 @@ Bug Fixes * SOLR-7949: Resolve XSS issue in Admin UI stats page (David Chiu via janhoy) +* SOLR-7956: There are interrupts on shutdown in places that can cause ChannelAlreadyClosed + exceptions which prevents proper closing of transaction logs. (Mark Miller) + Optimizations ---------------------- diff --git a/solr/core/src/java/org/apache/solr/cloud/OverseerProcessor.java b/solr/core/src/java/org/apache/solr/cloud/OverseerProcessor.java index 40ed5645773..18cd3359c22 100644 --- a/solr/core/src/java/org/apache/solr/cloud/OverseerProcessor.java +++ b/solr/core/src/java/org/apache/solr/cloud/OverseerProcessor.java @@ -298,16 +298,7 @@ public class OverseerProcessor implements Runnable, Closeable { isClosed = true; if(tpe != null) { if (!tpe.isShutdown()) { - tpe.shutdown(); - try { - tpe.awaitTermination(60, TimeUnit.SECONDS); - } catch (InterruptedException e) { - log.warn("Thread interrupted while waiting for OCP threadpool close."); - Thread.currentThread().interrupt(); - } finally { - if (!tpe.isShutdown()) - tpe.shutdownNow(); - } + ExecutorUtil.shutdownAndAwaitTermination(tpe); } } } diff --git a/solr/core/src/java/org/apache/solr/core/ZkContainer.java b/solr/core/src/java/org/apache/solr/core/ZkContainer.java index 33c3d1e86f9..6e5061163c8 100644 --- a/solr/core/src/java/org/apache/solr/core/ZkContainer.java +++ b/solr/core/src/java/org/apache/solr/core/ZkContainer.java @@ -247,7 +247,7 @@ public class ZkContainer { zkServer.stop(); } } finally { - ExecutorUtil.shutdownNowAndAwaitTermination(coreZkRegister); + ExecutorUtil.shutdownAndAwaitTermination(coreZkRegister); } } diff --git a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java index 322a92b1ec7..31874025c8f 100644 --- a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java @@ -700,7 +700,7 @@ public class SolrConfigHandler extends RequestHandlerBase { prop, expectedVersion, concurrentTasks.size(), collection)); Thread.currentThread().interrupt(); } finally { - ExecutorUtil.shutdownNowAndAwaitTermination(parallelExecutor); + ExecutorUtil.shutdownAndAwaitTermination(parallelExecutor); } log.info("Took {}ms to set the property {} to be of version {} for collection {}", diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java index 203e779716a..ccdd2ce2c45 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java +++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java @@ -219,7 +219,7 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory implements org. @Override public void close() { try { - ExecutorUtil.shutdownNowAndAwaitTermination(commExecutor); + ExecutorUtil.shutdownAndAwaitTermination(commExecutor); } finally { try { if (defaultClient != null) {