lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sale, Doug" <ds...@us.britannica.com>
Subject RE: FSDirectory patch for file renaming
Date Tue, 18 Feb 2003 21:19:52 GMT

i can call java.io.File.delete() and then java.io.File.exists() on the same
fila, and receive true (sporadically).  this occurs on Win2K w/NTFS and for
jvm's 1.3.1 and 1.4.1 (sun - haven't tested other versions/implementations).
java.io.FileDescriptor has a sync() method, that ensures all buffers have
been flushed to the device, but this object is only available from a
java.io.FileInputStream or a java.io.FileOutputStream (via getFD()) and
isn't really applicable here...

> -----Original Message-----
> From: Andrzej Bialecki [mailto:ab@getopt.org]
> Sent: Monday, February 17, 2003 4:11 PM
> To: Lucene Developers List
> Subject: Re: FSDirectory patch for file renaming
> 
> 
> Matt Tucker wrote:
> > Otis,
> > 
> > Yesterday, we had a data set on a particular Windows box that would
> > consistently bomb out with the rename error. That's what 
> finally motivated
> > me to make the patch. After applying the patch the rebuild 
> worked perfectly.
> > I also removed the renameTo method call and tested with my 
> manual copy code
> > being used all the time (that also worked perfectly).
> 
> Interesting... One of the causes for renameTo failing is when 
> the other 
> file already exists. Could you insert a check for nu.exists() right 
> after nu.delete()? Perhaps this check will be sufficient for 
> the problem 
> to disappear, because this behaviour looks to me like a 
> timing problem...
> 
> This could be a shot in the wild, but could it be caused by bad 
> timing/bad use of native API within JVM (e.g. a filesystem 
> caching the 
> requests)? Does it behave differently if run on FAT vs. NTFS 
> filesystem? 
> This would of course mean a gross violation of File.delete() 
> contract, 
> but JVM is just a program and it may contain bugs... Or maybe it's 
> Windows that contains bugs, I don't remember... ;-) Does it 
> behave the 
> same way in JDK 1.3.x as in JDK 1.4.x?
> 
> 
> -- 
> Best regards,
> Andrzej Bialecki
> 
> -------------------------------------------------
> Software Architect, System Integration Specialist
> -------------------------------------------------
> FreeBSD developer (http://www.freebsd.org)
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message