lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: running a lucene indexing app as a windows service on xp, crashing
Date Fri, 04 Aug 2006 21:28:02 GMT

> The Lucene code is crashing under circumstances that seem pretty lame.
> At periodic intervals, lucene tries to File.renameTo(newfile).
> Sometimes this fails, so Lucene implemented some fall-back code to
> manually copy the contents of the file from old to new.  Our problem is
> that sometimes *this* fails too, then the whole thing blows up.

I agree Lucene should not be affected by things like having Windows 
Explorer windows up!

Can you post the traceback you're seeing?  In particular, what's failing 
about the fallback approach?

Is it in the FSDirectory's renameFile method?  There is this comment in 
there:

     // Rename the old file to the new one. Unfortunately, the renameTo()
     // method does not work reliably under some JVMs.  Therefore, if the
     // rename fails, we manually rename by copying the old file to the 
new one

and correspondingly this comment in the original commit for this (back 
on March 1 2003):

- Added a manual renaming of files in case the java.io.File's renameTo(File)
   call fails.  It has been reported that this happens on Windows JVMs.
Contributed by: Matt Tucker

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message