Index: lucene/CHANGES.txt =================================================================== --- lucene/CHANGES.txt (revision 1221428) +++ lucene/CHANGES.txt (working copy) @@ -770,6 +770,9 @@ NRTCachingDir, fixed createOutput to overwrite any previous file, and removed invalid asserts (Robert Muir, Mike McCandless) +* LUCENE-3605: don't sleep in a retry loop when trying to locate the + segments_N file (Robert Muir, Mike McCandless) + Optimizations * LUCENE-3653: Improve concurrency in VirtualMethod and AttributeSource by Index: lucene/src/java/org/apache/lucene/index/SegmentInfos.java =================================================================== --- lucene/src/java/org/apache/lucene/index/SegmentInfos.java (revision 1221428) +++ lucene/src/java/org/apache/lucene/index/SegmentInfos.java (working copy) @@ -447,36 +447,10 @@ /* Advanced configuration of retry logic in loading segments_N file */ - private static int defaultGenFileRetryCount = 10; private static int defaultGenFileRetryPauseMsec = 50; private static int defaultGenLookaheadCount = 10; /** - * Advanced: set how many times to try loading the - * segments.gen file contents to determine current segment - * generation. This file is only referenced when the - * primary method (listing the directory) fails. - */ - public static void setDefaultGenFileRetryCount(int count) { - defaultGenFileRetryCount = count; - } - - /** - * @see #setDefaultGenFileRetryCount - */ - public static int getDefaultGenFileRetryCount() { - return defaultGenFileRetryCount; - } - - /** - * Advanced: set how many milliseconds to pause in between - * attempts to load the segments.gen file. - */ - public static void setDefaultGenFileRetryPauseMsec(int msec) { - defaultGenFileRetryPauseMsec = msec; - } - - /** * @see #setDefaultGenFileRetryPauseMsec */ public static int getDefaultGenFileRetryPauseMsec() { @@ -599,53 +573,41 @@ // a stale cache (NFS) we have a better chance of // getting the right generation. long genB = -1; - for(int i=0;i