lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Modrall" <>
Subject RE: running a lucene indexing app as a windows service on xp, crashing
Date Fri, 04 Aug 2006 21:45:08 GMT
Hi Michael...

Here's the traceback:
[ 652] buildFullIndex: Error building full index Cannot rename
D:\indexbuild1\contact_index\ to
D:\indexbuild1\contact_index\deletable at at
a:827) at
 com.glgroup.glissando.Indexer.indexAllDocuments( at
 com.glgroup.glissando.Indexer.buildFullIndex( at
 com.glgroup.glissando.Indexer.buildIndex( at
 com.glgroup.glissando.Indexer.buildIndices( at
9) at
Caused by:
D:\indexbuild1\contact_index\deletable (Access is denied) at Method) at<init>(Unknown Source) at<init>(Unknown Source) at
... 13 more

	So you can see, yes it's exactly in that spot.  Given the
circumstances we've seen, it seems like File.renameTo() is working most
of the  time but whatever causes it to fail at this specific point in
time also causes the 
New FileOutputStream (nu);
 to blow up 2 lines later.

	As I said, the trigger seems to be Windows Explorer doing a
refresh at the same moment that Lucene is trying to do one of these
swaps.  I don't know if this is a weakness in the jvm implementation of
the file classes or what, but I've found complaints/bugs about the java
file interactions on windows coming up to 2004.


This e-mail message, and any attachments, is intended only for the use of the individual or
entity identified in the alias address of this message and may contain information that is
confidential, privileged and subject to legal restrictions and penalties regarding its unauthorized
disclosure and use. Any unauthorized review, copying, disclosure, use or distribution is strictly
prohibited. If you have received this e-mail message in error, please notify the sender immediately
by reply e-mail and delete this message, and any attachments, from your system. Thank you.

-----Original Message-----

From: Michael McCandless [] 
Sent: Friday, August 04, 2006 5:28 PM
Subject: Re: running a lucene indexing app as a windows service on xp,

> 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
> 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 

     // Rename the old file to the new one. Unfortunately, the
     // method does not work reliably under some JVMs.  Therefore, if
     // 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's
   call fails.  It has been reported that this happens on Windows JVMs.
Contributed by: Matt Tucker


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message