lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1026888 - in /lucene/solr/branches/branch-1.4: CHANGES.txt src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java
Date Sun, 24 Oct 2010 21:09:16 GMT
Author: yonik
Date: Sun Oct 24 21:09:16 2010
New Revision: 1026888

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

Modified:
    lucene/solr/branches/branch-1.4/CHANGES.txt
    lucene/solr/branches/branch-1.4/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java

Modified: lucene/solr/branches/branch-1.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/branches/branch-1.4/CHANGES.txt?rev=1026888&r1=1026887&r2=1026888&view=diff
==============================================================================
--- lucene/solr/branches/branch-1.4/CHANGES.txt (original)
+++ lucene/solr/branches/branch-1.4/CHANGES.txt Sun Oct 24 21:09:16 2010
@@ -62,6 +62,9 @@ Bug Fixes
 * SOLR-2180: It was possible for EmbeddedSolrServer to leave searchers
   open if a request threw an exception. (yonik)
 
+* SOLR-2192: StreamingUpdateSolrServer.blockUntilFinished was not
+  thread safe and could throw an exception. (yonik)
+
 
 ================== Release 1.4.1 ==================
 Release Date:  See http://lucene.apache.org/solr for the official release date.

Modified: lucene/solr/branches/branch-1.4/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/branch-1.4/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java?rev=1026888&r1=1026887&r2=1026888&view=diff
==============================================================================
--- lucene/solr/branches/branch-1.4/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java
(original)
+++ lucene/solr/branches/branch-1.4/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java
Sun Oct 24 21:09:16 2010
@@ -227,18 +227,21 @@ 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();
       lock=null;
     }
   }
-  
+ 
   public void handleError( Throwable ex )
   {
     log.error( "error", ex );



Mime
View raw message