You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2010/10/24 22:41:32 UTC

svn commit: r1026882 - /lucene/dev/trunk/solr/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java

Author: yonik
Date: Sun Oct 24 20:41:32 2010
New Revision: 1026882

URL: http://svn.apache.org/viewvc?rev=1026882&view=rev
Log:
SOLR-2192: sync runners in StreamingUpdateSolrServer.blockUntilFinished

Modified:
    lucene/dev/trunk/solr/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java

Modified: lucene/dev/trunk/solr/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java?rev=1026882&r1=1026881&r2=1026882&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java (original)
+++ lucene/dev/trunk/solr/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java Sun Oct 24 20:41:32 2010
@@ -244,11 +244,14 @@ public class StreamingUpdateSolrServer e
     lock = new CountDownLatch(1);
     try {
       // Wait until no runners are running
-      Runner runner = runners.peek();
-      while( runner != null ) {
+      for(;;) {
+        Runner runner;
+        synchronized(runners) {
+          runner = runners.peek();
+        }
+        if (runner == null) break;
         runner.runnerLock.lock();
         runner.runnerLock.unlock();
-        runner = runners.peek();
       }
     } finally {
       lock.countDown();