Building a new index using FSDirectory.open(new File(path) on a FAT32 drive from OSX. Once the index has built but the index writer has not been closed because I want to optimize it I create a new indexwriter to create a second completely different index. However this fails with
Exception in thread "main" java.nio.channels.OverlappingFileLockException
but this should not occur as I am not locking the same file, this second index is being built in a different directory albeit with the same parent directory as the other index.
I think the issue is specifically to do with OSX - FAT32 interaction because the problem always occurs, but never occurs if I build the indexes on the internal Mac drive.
The only way I could resolve this was to remove locking using
FSDirectory.open(new File(path), NoLockFactory.getNoLockFactory() );