lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <>
Subject Re: OverlappingFileLockException when optimizing large index
Date Thu, 22 Sep 2011 12:57:56 GMT
On 22/09/2011 11:56, Paul Taylor wrote:
> Id made just a few changes to my code to remove deprecations that 
> ocurred when I upgraded to Lucene 3.1, all tests work fine but when I 
> tried to build a real index it gives this error during optimization stage
> Exception in thread "main" java.nio.channels.OverlappingFileLockException
>     at 
>     at 
>     at
>     at java.nio.channels.FileChannel.tryLock(
>     at 
>     at
>     at org.apache.lucene.index.IndexWriter.<init>(
>     at 
>     at 
>     at 
Some progress with this Ive realized the problem isn't with my code 
changes but  where the indexes are being created. I am running on a Mac 
with OSX10.7 Lion with a connected external format as MS-DOS FAT-32.
If I build the indexes to my mac hardrive it always works, but if I 
write to the external harddrive fails(note this is just an externally 
connected drive not a network drive), the problem occurs when trying to 
initilize the 2nd IndexWriter, the first IndexWriter has finished 
building the index but hasnt closed the writer yet because it has now 
started optmizing the index.

I dont understand why they seem to be using the same lock because they 
are creating different indexes and indexing them to different subfolders.

So it seems the problem might be because Im running MacOS but using a 
Windows filesystem to store the indexes so instead of using I instantiated an MMAPDirectory, but got the same error.
I then tried specifying a different lock factory

fsDir = File(path), new SimpleFSLockFactory() );

and now it fails in the same place but with a timeout problem

Exception in thread "main" Lock obtain timed 
     at org.apache.lucene.index.IndexWriter.<init>(


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

View raw message