lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbern...@apache.org
Subject lucene-solr git commit: SOLR-8832: Faulty DaemonStream shutdown procedures
Date Fri, 11 Mar 2016 20:41:01 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 164d6ccd2 -> 26f230a47


SOLR-8832: Faulty DaemonStream shutdown procedures


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/26f230a4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/26f230a4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/26f230a4

Branch: refs/heads/branch_6x
Commit: 26f230a4740e281ee9b43ed60bb8d24c4ed8dbdc
Parents: 164d6cc
Author: jbernste <jbernste@apache.org>
Authored: Fri Mar 11 15:34:31 2016 -0500
Committer: jbernste <jbernste@apache.org>
Committed: Fri Mar 11 15:42:51 2016 -0500

----------------------------------------------------------------------
 .../org/apache/solr/client/solrj/io/stream/DaemonStream.java | 6 +++++-
 .../solr/client/solrj/io/stream/StreamExpressionTest.java    | 8 ++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/26f230a4/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java
b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java
index 2f65394..edafd7e 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java
@@ -171,11 +171,16 @@ public class DaemonStream extends TupleStream implements Expressible
{
     this.tupleStream.setStreamContext(streamContext);
   }
 
+  public void shutdown() {
+    streamRunner.setShutdown(true);
+  }
+
   public void close() {
     if(closed) {
       return;
     }
     streamRunner.setShutdown(true);
+    this.closed = true;
   }
 
   public List<TupleStream> children() {
@@ -226,7 +231,6 @@ public class DaemonStream extends TupleStream implements Expressible {
 
     public synchronized void setShutdown(boolean shutdown) {
       this.shutdown = shutdown;
-      interrupt(); //We could be blocked on the queue or sleeping
     }
 
     public synchronized boolean getShutdown() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/26f230a4/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
index 465369b..e7f57c1 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java
@@ -623,7 +623,7 @@ public class StreamExpressionTest extends AbstractFullDistribZkTestBase
{
     DaemonStream daemonStream;
 
     expression = StreamExpressionParser.parse("daemon(rollup("
-        + "search(collection1, q=*:*, fl=\"a_i,a_s\", sort=\"a_s asc\"),"
+        + "search(collection1, q=\"*:*\", fl=\"a_i,a_s\", sort=\"a_s asc\"),"
         + "over=\"a_s\","
         + "sum(a_i)"
         + "), id=\"test\", runInterval=\"1000\", queueSize=\"9\")");
@@ -2366,13 +2366,17 @@ public class StreamExpressionTest extends AbstractFullDistribZkTestBase
{
         assertEquals(14, (long) tuple.getLong(id));
         tuple = dstream.read(); // This should trigger a checkpoint as it's the 4th read
from the stream.
         assertEquals(15, (long) tuple.getLong(id));
+
+        dstream.shutdown();
+        tuple = dstream.read();
+        assertTrue(tuple.EOF);
       } finally {
         dstream.close();
       }
     } finally {
-      cache.close();
       del("*:*");
       commit();
+      cache.close();
     }
   }
 


Mime
View raw message