lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r949473 - in /lucene/solr/branches/branch-1.4: ./ CHANGES.txt src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java
Date Sun, 30 May 2010 04:43:03 GMT
Author: hossman
Date: Sun May 30 04:43:03 2010
New Revision: 949473

URL: http://svn.apache.org/viewvc?rev=949473&view=rev
Log:
merging r903271 from solr/branches/branch-1.5-dev for SOLR-1711

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

Propchange: lucene/solr/branches/branch-1.4/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun May 30 04:43:03 2010
@@ -1 +1 @@
-/lucene/solr/trunk:881642,881906,883566,891596,891889
+/lucene/solr/trunk:881642,881906,883566,891596,891889,903271

Modified: lucene/solr/branches/branch-1.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/branches/branch-1.4/CHANGES.txt?rev=949473&r1=949472&r2=949473&view=diff
==============================================================================
--- lucene/solr/branches/branch-1.4/CHANGES.txt (original)
+++ lucene/solr/branches/branch-1.4/CHANGES.txt Sun May 30 04:43:03 2010
@@ -65,6 +65,9 @@ Bug Fixes
 * SOLR-1662: Added Javadocs in BufferedTokenStream and fixed incorrect cloning
   in TestBufferedTokenStream (Robert Muir, Uwe Schindler via shalin)
 
+* SOLR-1711: SolrJ - StreamingUpdateSolrServer had a race condition that
+  could halt the streaming of documents. (Attila Babo via yonik)
+
 ================== Release 1.4.0 ==================
 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=949473&r1=949472&r2=949473&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 May 30 04:43:03 2010
@@ -82,6 +82,7 @@ public class StreamingUpdateSolrServer e
       log.info( "starting runner: {}" , this );
       PostMethod method = null;
       try {
+        do {
         RequestEntity request = new RequestEntity() {
           // we don't know the length
           public long getContentLength() { return -1; }
@@ -142,6 +143,7 @@ public class StreamingUpdateSolrServer e
           msg.append( "request: "+method.getURI() );
           handleError( new Exception( msg.toString() ) );
         }
+        }  while( ! queue.isEmpty());
       }
       catch (Throwable e) {
         handleError( e );
@@ -149,6 +151,7 @@ public class StreamingUpdateSolrServer e
       finally {
         try {
           // make sure to release the connection
+          if(method != null)
           method.releaseConnection();
         }
         catch( Exception ex ){}
@@ -195,11 +198,11 @@ public class StreamingUpdateSolrServer e
 
       queue.put( req );
       
+        synchronized( runners ) {
       if( runners.isEmpty() 
         || (queue.remainingCapacity() < queue.size() 
          && runners.size() < threadCount) ) 
       {
-        synchronized( runners ) {
           Runner r = new Runner();
           scheduler.execute( r );
           runners.add( r );



Mime
View raw message