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 ry...@apache.org on 2008/11/20 20:52:12 UTC

svn commit: r719347 - /lucene/solr/trunk/src/java/org/apache/solr/update/DirectUpdateHandler2.java

Author: ryan
Date: Thu Nov 20 11:52:11 2008
New Revision: 719347

URL: http://svn.apache.org/viewvc?rev=719347&view=rev
Log:
SOLR-793: fix possible deadlock

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/update/DirectUpdateHandler2.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/update/DirectUpdateHandler2.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/update/DirectUpdateHandler2.java?rev=719347&r1=719346&r2=719347&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/update/DirectUpdateHandler2.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/update/DirectUpdateHandler2.java Thu Nov 20 11:52:11 2008
@@ -466,6 +466,11 @@
     /** schedule individual commits */
     public synchronized void scheduleCommitWithin(long commitMaxTime) 
     {
+      _scheduleCommitWithin( commitMaxTime );
+    }
+    
+    private void _scheduleCommitWithin(long commitMaxTime) 
+    {
       // Check if there is a commit already scheduled for longer then this time
       if( pending != null && 
           pending.getDelay(TimeUnit.MILLISECONDS) >= commitMaxTime ) 
@@ -487,13 +492,13 @@
       lastAddedTime = System.currentTimeMillis();
       // maxDocs-triggered autoCommit
       if( docsUpperBound > 0 && (docsSinceCommit > docsUpperBound) ) {
-        scheduleCommitWithin( DOC_COMMIT_DELAY_MS );
+        _scheduleCommitWithin( DOC_COMMIT_DELAY_MS );
       }
       
       // maxTime-triggered autoCommit
       long ctime = (commitWithin>0) ? commitWithin : timeUpperBound;
       if( ctime > 0 ) {
-        scheduleCommitWithin( ctime );
+        _scheduleCommitWithin( ctime );
       }
     }