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/07/22 01:38:27 UTC

[lucene-solr] branch reference_impl updated: @281 Propagate interrupt.

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


The following commit(s) were added to refs/heads/reference_impl by this push:
     new 0e8a800  @281 Propagate interrupt.
0e8a800 is described below

commit 0e8a8009be6a763fa53fcd1ab0a6374c2046696b
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Tue Jul 21 20:38:16 2020 -0500

    @281 Propagate interrupt.
---
 .../src/java/org/apache/solr/handler/component/HttpShardHandler.java   | 3 ++-
 solr/test-framework/src/java/org/apache/solr/SolrTestCase.java         | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
index 8fb7d48..282b2f4 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
@@ -380,7 +380,7 @@ public class HttpShardHandler extends ShardHandler {
 
       while (pending.size() > 0 && !Thread.currentThread().isInterrupted()) {
         try {
-          Future<ShardResponse> future = completionService.poll(Integer.getInteger("solr.httpShardHandler.completionTimeout", 10), TimeUnit.SECONDS);
+          Future<ShardResponse> future = completionService.poll(Integer.getInteger("solr.httpShardHandler.completionTimeout", 10000), TimeUnit.MILLISECONDS);
           pending.remove(future);
           ShardResponse rsp = future.get();
           if (bailOnError && rsp.getException() != null) return rsp; // if exception, return immediately
@@ -560,6 +560,7 @@ public class HttpShardHandler extends ShardHandler {
                 try {
                   shardLeader = zkController.getZkStateReader().getLeaderRetry(cloudDescriptor.getCollectionName(), slice.getName());
                 } catch (InterruptedException e) {
+                  ParWork.propegateInterrupt(e);
                   throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, "Exception finding leader for shard " + slice.getName() + " in collection "
                           + cloudDescriptor.getCollectionName(), e);
                 } catch (SolrException e) {
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
index 37663af..1a4e0c5 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
@@ -201,6 +201,9 @@ public class SolrTestCase extends LuceneTestCase {
 
     if (!TEST_NIGHTLY) {
       //TestInjection.randomDelayMaxInCoreCreationInSec = 2;
+
+
+      System.setProperty("solr.httpShardHandler.completionTimeout", "1000");
       System.setProperty("zookeeper.request.timeout", "5000");
       System.setProperty(SolrTestCaseJ4.USE_NUMERIC_POINTS_SYSPROP, "false");
 //      System.setProperty("solr.tests.IntegerFieldType", "org.apache.solr.schema.IntPointField");