lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r769431 - /lucene/java/trunk/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
Date Tue, 28 Apr 2009 15:12:54 GMT
Author: mikemccand
Date: Tue Apr 28 15:12:53 2009
New Revision: 769431

URL: http://svn.apache.org/viewvc?rev=769431&view=rev
Log:
make default exception handler in ConcurrentMergeHandler pause for 250 msec after each exception,
to prevent saturating CPU

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=769431&r1=769430&r2=769431&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 15:12:53 2009
@@ -340,6 +340,13 @@
   /** Called when an exception is hit in a background merge
    *  thread */
   protected void handleMergeException(Throwable exc) {
+    try {
+      Thread.sleep(250);
+    } catch (InterruptedException ie) {
+      Thread.currentThread().interrupt();
+      // In 3.0 this will throw InterruptedException
+      throw new RuntimeException(ie);
+    }
     throw new MergePolicy.MergeException(exc, dir);
   }
 



Mime
View raw message