You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/09/04 11:16:18 UTC
[lucene-solr] 12/13: @731 Fix wait on close.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 65a3657f679dff159423ada407963eaca8fb5ae3
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Thu Sep 3 18:25:41 2020 -0500
@731 Fix wait on close.
---
.../org/apache/solr/client/solrj/io/stream/ExecutorStream.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExecutorStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExecutorStream.java
index 740ee75..8d67b0a 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExecutorStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExecutorStream.java
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Locale;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
import org.apache.solr.client.solrj.io.Tuple;
import org.apache.solr.client.solrj.io.comp.StreamComparator;
@@ -132,11 +133,16 @@ public class ExecutorStream extends TupleStream implements Expressible {
}
public void open() throws IOException {
- executorService = ParWork.getRootSharedExecutor();
+ executorService = ParWork.getMyPerThreadExecutor();
stream.open();
}
public void close() throws IOException {
+ try {
+ executorService.awaitTermination(30, TimeUnit.SECONDS);
+ } catch (InterruptedException e) {
+ ParWork.propegateInterrupt(e);
+ }
stream.close();
}