You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by yo...@apache.org on 2010/01/26 16:33:26 UTC
svn commit: r903271 - in /lucene/solr/trunk: CHANGES.txt
src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java
Author: yonik
Date: Tue Jan 26 15:33:26 2010
New Revision: 903271
URL: http://svn.apache.org/viewvc?rev=903271&view=rev
Log:
SOLR-1711: StreamingUpdateSolrServer race
Modified:
lucene/solr/trunk/CHANGES.txt
lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java
Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=903271&r1=903270&r2=903271&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Tue Jan 26 15:33:26 2010
@@ -162,6 +162,9 @@
* SOLR-1667: PatternTokenizer does not reset attributes such as positionIncrementGap
(Robert Muir via shalin)
+* SOLR-1711: SolrJ - StreamingUpdateSolrServer had a race condition that
+ could halt the streaming of documents. (Attila Babo via yonik)
+
Other Changes
----------------------
Modified: lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java?rev=903271&r1=903270&r2=903271&view=diff
==============================================================================
--- lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java (original)
+++ lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.java Tue Jan 26 15:33:26 2010
@@ -99,6 +99,7 @@
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; }
@@ -159,6 +160,7 @@
msg.append( "request: "+method.getURI() );
handleError( new Exception( msg.toString() ) );
}
+ } while( ! queue.isEmpty());
}
catch (Throwable e) {
handleError( e );
@@ -166,6 +168,7 @@
finally {
try {
// make sure to release the connection
+ if(method != null)
method.releaseConnection();
}
catch( Exception ex ){}
@@ -212,11 +215,11 @@
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 );