lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <paul_t...@fastmail.fm>
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 
> sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166)
>     at 
> sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068)
>     at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:868)
>     at java.nio.channels.FileChannel.tryLock(FileChannel.java:962)
>     at 
> org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:216)
>     at org.apache.lucene.store.Lock.obtain(Lock.java:72)
>     at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1097)
>     at 
> org.musicbrainz.search.index.ThreadedIndexWriter.<init>(ThreadedIndexWriter.java:66)
>     at 
> org.musicbrainz.search.index.IndexBuilder.createIndexWriter(IndexBuilder.java:229)
>     at 
> org.musicbrainz.search.index.IndexBuilder.main(IndexBuilder.java:152)
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 
FSDirectory.open() I instantiated an MMAPDirectory, but got the same error.
I then tried specifying a different lock factory

fsDir = FSDirectory.open(new File(path), new SimpleFSLockFactory() );

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

Exception in thread "main" 
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed 
out: 
SimpleFSLock@/Volumes/DDRIVE/Shared/Musicbrainz/releasegroup_index/write.lock
     at org.apache.lucene.store.Lock.obtain(Lock.java:84)
     at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1112)
     at 
org.musicbrainz.search.index.ThreadedIndexWriter.<init>(ThreadedIndexWriter.java:66)
     at 
org.musicbrainz.search.index.IndexBuilder.createIndexWriter(IndexBuilder.java:230)
     at 
org.musicbrainz.search.index.IndexBuilder.main(IndexBuilder.java:153)

Paul


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