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/08/31 13:32:57 UTC

[lucene-solr] branch reference_impl updated (d8e9aa6 -> f05aa8f)

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a change to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from d8e9aa6  @642 Try and settle down this leak, even though it's essentially a valid leak, we don't deal with it quite yet.
     new 2e30e3a  @643 Now that this can hit in a spot in our threadpool logic, we have been allowing interrupt - after seeing a very rare searcher loading executor leak, let's try a short wait before responding to interrupt.
     new f05aa8f  @644 Try and help this test a little - it can rarely cause a hang due to socket timeout.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../solr/client/solrj/io/stream/SolrStream.java    |  1 +
 .../org/apache/solr/common/util/ExecutorUtil.java  |  7 +++++--
 .../client/solrj/io/graph/GraphExpressionTest.java | 24 +++++++---------------
 3 files changed, 13 insertions(+), 19 deletions(-)


[lucene-solr] 02/02: @644 Try and help this test a little - it can rarely cause a hang due to socket timeout.

Posted by ma...@apache.org.
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 f05aa8f80edf3fd3b76e33ef088dce5239f5f048
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Mon Aug 31 08:30:28 2020 -0500

    @644 Try and help this test a little - it can rarely cause a hang due to socket timeout.
---
 .../solr/client/solrj/io/stream/SolrStream.java    |  1 +
 .../client/solrj/io/graph/GraphExpressionTest.java | 24 +++++++---------------
 2 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java
index e17a768..8ea764f 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java
@@ -126,6 +126,7 @@ public class SolrStream extends TupleStream {
       if (!distrib) {
         ((ModifiableSolrParams) requestParams).add("distrib","false");
       }
+      assert tupleStreamParser == null;
       tupleStreamParser = constructParser(client, requestParams);
     } catch (Exception e) {
       ParWork.propegateInterrupt(e);
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/graph/GraphExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/graph/GraphExpressionTest.java
index 7d303f4..ab3a9b7 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/graph/GraphExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/graph/GraphExpressionTest.java
@@ -73,7 +73,6 @@ import org.junit.Test;
  **/
 
 @Slow
-//@Ignore // nocommit flakey
 @LuceneTestCase.SuppressCodecs({"Lucene3x", "Lucene40","Lucene41","Lucene42","Lucene45"})
 public class GraphExpressionTest extends SolrCloudTestCase {
 
@@ -247,7 +246,6 @@ public class GraphExpressionTest extends SolrCloudTestCase {
   }
 
   @Test
-  @Ignore // nocommit - look again after i go through streaming again
   public void testGatherNodesStream() throws Exception {
 
     new UpdateRequest()
@@ -306,6 +304,7 @@ public class GraphExpressionTest extends SolrCloudTestCase {
         "maxDocFreq=\"2\","+
         "gather=\"basket_s\")";
 
+    stream.close();
     stream = (GatherNodesStream)factory.constructStream(docFreqExpr);
     stream.setStreamContext(context);
 
@@ -321,6 +320,7 @@ public class GraphExpressionTest extends SolrCloudTestCase {
         "walk=\"node->basket_s\"," +
         "gather=\"product_s\", count(*), avg(price_f), sum(price_f), min(price_f), max(price_f))";
 
+    stream.close();
     stream = (GatherNodesStream)factory.constructStream(expr2);
 
     context = new StreamContext();
@@ -359,6 +359,7 @@ public class GraphExpressionTest extends SolrCloudTestCase {
         "walk=\"product4, product7->product_s\"," +
         "gather=\"basket_s\")";
 
+    stream.close();
     stream = (GatherNodesStream)factory.constructStream(expr);
 
     context = new StreamContext();
@@ -377,6 +378,7 @@ public class GraphExpressionTest extends SolrCloudTestCase {
         "walk=\"product4, product7->product_s\"," +
         "gather=\"basket_s\", fq=\"-basket_s:basket4\")";
 
+    stream.close();
     stream = (GatherNodesStream)factory.constructStream(expr);
 
     context = new StreamContext();
@@ -389,8 +391,8 @@ public class GraphExpressionTest extends SolrCloudTestCase {
     assertTrue(tuples.get(0).getString("node").equals("basket2"));
     assertTrue(tuples.get(1).getString("node").equals("basket3"));
 
+    stream.close();
     cache.close();
-
   }
 
 
@@ -489,6 +491,7 @@ public class GraphExpressionTest extends SolrCloudTestCase {
                                                                    "min(price_f), " +
                                                                    "max(price_f))))";
 
+    stream.close();
     stream = factory.constructStream(expr2);
 
     context = new StreamContext();
@@ -513,6 +516,7 @@ public class GraphExpressionTest extends SolrCloudTestCase {
     assert(tuple2.getLong("docFreq") == 8);
     assert(tuple2.getDouble("avg(price_f)") == 1);
 
+    stream.close();
     cache.close();
   }
 
@@ -586,10 +590,6 @@ public class GraphExpressionTest extends SolrCloudTestCase {
     cache.close();
   }
 
-
-
-
-
   @Test
   public void testGatherNodesFriendsStream() throws Exception {
 
@@ -914,11 +914,6 @@ public class GraphExpressionTest extends SolrCloudTestCase {
     client.close();
   }
 
-
-
-
-
-
   private String readString(InputStreamReader reader) throws Exception{
     StringBuilder builder = new StringBuilder();
     int c = 0;
@@ -929,9 +924,6 @@ public class GraphExpressionTest extends SolrCloudTestCase {
     return builder.toString();
   }
 
-
-
-
   protected List<Tuple> getTuples(TupleStream tupleStream) throws IOException {
     tupleStream.open();
     List<Tuple> tuples = new ArrayList();
@@ -973,8 +965,6 @@ public class GraphExpressionTest extends SolrCloudTestCase {
       throw new Exception("Longs not equal:"+expected+" : "+actual);
     }
 
-
-
     return true;
   }
 


[lucene-solr] 01/02: @643 Now that this can hit in a spot in our threadpool logic, we have been allowing interrupt - after seeing a very rare searcher loading executor leak, let's try a short wait before responding to interrupt.

Posted by ma...@apache.org.
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 2e30e3aa0f79dc0760d1347ae0790567cdb69a0c
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Mon Aug 31 08:11:25 2020 -0500

    @643 Now that this can hit in a spot in our threadpool logic, we have been allowing interrupt - after seeing a very rare searcher loading executor leak, let's try a short wait before responding to interrupt.
---
 solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java b/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java
index d158df7..686e699 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java
@@ -79,7 +79,8 @@ public class ExecutorUtil {
 
   public static void awaitTermination(ExecutorService pool) {
     boolean shutdown = false;
-
+    // if interrupted, we still wait a short time for thread stoppage, but then quickly bail
+    TimeOut interruptTimeout = new TimeOut(1000, TimeUnit.MILLISECONDS, TimeSource.NANO_TIME);
     boolean interrupted = false;
     do {
       try {
@@ -87,7 +88,9 @@ public class ExecutorUtil {
         shutdown = pool.awaitTermination(30, TimeUnit.SECONDS);
       } catch (InterruptedException ie) {
         interrupted = true;
-        break;
+        if (interruptTimeout.hasTimedOut()) {
+          break;
+        }
       }
     } while (shutdown == false);