You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by mi...@apache.org on 2009/04/28 22:59:45 UTC

svn commit: r769533 - /lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java

Author: mikemccand
Date: Tue Apr 28 20:59:44 2009
New Revision: 769533

URL: http://svn.apache.org/viewvc?rev=769533&view=rev
Log:
remove dead code (exceptions list) from ConcurrentMergeScheduler; add comment to the 250 msec sleep

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java?rev=769533&r1=769532&r2=769533&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java Tue Apr 28 20:59:44 2009
@@ -41,7 +41,6 @@
   // Max number of threads allowed to be merging at once
   private int maxThreadCount = 3;
 
-  private List exceptions = new ArrayList();
   protected Directory dir;
 
   private boolean closed;
@@ -309,10 +308,6 @@
 
         // Ignore the exception if it was due to abort:
         if (!(exc instanceof MergePolicy.MergeAbortedException)) {
-          synchronized(ConcurrentMergeScheduler.this) {
-            exceptions.add(exc);
-          }
-          
           if (!suppressExceptions) {
             // suppressExceptions is normally only set during
             // testing.
@@ -341,6 +336,12 @@
    *  thread */
   protected void handleMergeException(Throwable exc) {
     try {
+      // When an exception is hit during merge, IndexWriter
+      // removes any partial files and then allows another
+      // merge to run.  If whatever caused the error is not
+      // transient then the exception will keep happening,
+      // so, we sleep here to avoid saturating CPU in such
+      // cases:
       Thread.sleep(250);
     } catch (InterruptedException ie) {
       Thread.currentThread().interrupt();