Apache Lucene open-source search software
SOLR-793: fix possible deadlock
Ryan McKinley075cdc58900b
diff --git a/src/java/org/apache/solr/update/DirectUpdateHandler2.java b/src/java/org/apache/solr/update/DirectUpdateHandler2.javaindex e379d40027f..1961938087d 100644--- a/src/java/org/apache/solr/update/DirectUpdateHandler2.java+++ b/src/java/org/apache/solr/update/DirectUpdateHandler2.java@@ -465,6 +465,11 @@ public class DirectUpdateHandler2 extends UpdateHandler {/** 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 timeif( pending != null &&@@ -487,13 +492,13 @@ public class DirectUpdateHandler2 extends UpdateHandler {lastAddedTime = System.currentTimeMillis();// maxDocs-triggered autoCommitif( docsUpperBound > 0 && (docsSinceCommit > docsUpperBound) ) {- scheduleCommitWithin( DOC_COMMIT_DELAY_MS );+ _scheduleCommitWithin( DOC_COMMIT_DELAY_MS );}// maxTime-triggered autoCommitlong ctime = (commitWithin>0) ? commitWithin : timeUpperBound;if( ctime > 0 ) {- scheduleCommitWithin( ctime );+ _scheduleCommitWithin( ctime );}}