This is because Lucene uses Native Filesystem Locks. The lock file itself is 
just a placeholder which is not cleaned up on Ctrl-C. The lock is not the file 
itself, its *on* the file.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de

> -----Original Message-----
> From: Pulkit Singhal [mailto:pulkitsing...@gmail.com]
> Sent: Wednesday, November 10, 2010 3:38 PM
> To: java-user@lucene.apache.org
> Subject: IndexWriters and write locks
> 
> Hello,
> 
> 1) On Windows, I often shut down my application server (which has active
> IndexWriters open) using the ctrl+c keys.
> 2) I inspect my directories on the file system I see that the write.lock file 
> is still
> there.
> 3) I start the app server again, and do some operations that would require
> IndexWriters to write to the same directories again and it works!
> 
> I don't understand why I do not run into any exceptions?
> I mean there is already a lock file present which should prevent the
> IndexWriters from getting access to the directories ... no?
> I should be happy but I'm not because other folks are able to get exceptions
> when they bounce their servers an I'm unable to reproduce the problem and I
> can't help them.
> 
> Any clues? Anyone?
> 
> Thank You,
> - Pulkit


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

Reply via email to