make default exception handler in ConcurrentMergeHandler pause for 250 msec after each exception, to prevent saturating CPU

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@769431 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-04-28 15:12:53 +00:00
parent ea90d1152d
commit 8c8500d1f8
1 changed files with 7 additions and 0 deletions

View File

@ -340,6 +340,13 @@ public class ConcurrentMergeScheduler extends MergeScheduler {
/** 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);
}