You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Frank Kunemann <fr...@innosystec.de> on 2006/10/19 08:53:50 UTC

NativeFSLockFactory problem

 
Hi all,

I'm trying to use the new class NativeFSLockFactory, but as you can guess I
have a problem using it.
Don't know what I'm doing wrong, so here is the code:


FSDirectory dir = FSDirectory.getDirectory(indexDir, create,
NativeFSLockFactory.getLockFactory());
logger.info("Index: "+indexDir.getAbsolutePath()+" Lock file:
"+dir.getLockID());
this.writer = new IndexWriter(dir, new StandardAnalyzer(), create);


Just to explain: indexDir is a file, create is set to false. 2nd line is to
see what is going on.


My problem is that there are many indices, for testing purpose just 4 of
them. The first one is started and working like it should, but from the 2nd
on I get those "Lock obtain timed out"- exceptions.
This is the log output:

08:38:05,199 INFO  [IndexerManager] No indexer found for directory
D:\[mydir]\index1- starting new one!
08:38:05,199 INFO  [Indexer] Index: D:\[mydir]\index1 Lock file:
lucene-0ca7838f9396a636d1feda5aabb9b8db
08:38:05,215 INFO  [IndexerManager] New amount of Indexers: 1
08:38:05,215 INFO  [IndexerManager] No indexer found for directory
D:\[mydir]\index2- starting new one!
08:38:05,215 INFO  [Indexer] Index: D:\[mydir]\index2 Lock file:
lucene-cc9dfaabbf7ad61c4bb3af007b88288c
08:38:06,213 ERROR [IndexerManager] Lock obtain timed out:
NativeFSLock@C:\Dokumente und Einstellungen\[user]\Lokale
Einstellungen\Temp\lucene-fd415060ae453638d69faa9fa07fbe95-n-write.lock
java.io.IOException: Lock obtain timed out: NativeFSLock@C:\Dokumente und
Einstellungen\[user]\Lokale
Einstellungen\Temp\lucene-fd415060ae453638d69faa9fa07fbe95-n-write.lock
	at org.apache.lucene.store.Lock.obtain(Lock.java:68)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:257)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:247)
	at de.innosystec.iar.indexing.Indexer.setUp(Indexer.java:101)
	at de.innosystec.iar.indexing.Indexer.<init>(Indexer.java:80)
	at
de.innosystec.iar.indexing.IndexerManager.addDocumentElement(IndexerManager.
java:228)
	at
de.innosystec.iar.parsing.ParserManager.indexDocumentElement(ParserManager.j
ava:286)
	at
de.innosystec.iar.parsing.ParserThread.startWorking(ParserThread.java:378)
	at de.innosystec.iar.parsing.ParserThread.run(ParserThread.java:175)
	at java.lang.Thread.run(Unknown Source)


The lock file mentioned in the exception is really created and used by the
first index. Seems like the FSDirectory.getLockID method doesn't work for
NativeFSLockFactory?
I'm using Win XP on my test platform.


Regards,
Frank


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


RE: NativeFSLockFactory problem

Posted by Frank Kunemann <fr...@innosystec.de>.
Hi Mike,

no problem. Just good to know its not my fault this time... ;)


Regards,
Frank

-----Original Message-----
From: Michael McCandless [mailto:lucene@mikemccandless.com] 
Sent: Thursday, October 19, 2006 12:03 PM
To: java-user@lucene.apache.org
Subject: Re: NativeFSLockFactory problem

Frank Kunemann wrote:
>  
> Hi all,
> 
> I'm trying to use the new class NativeFSLockFactory, but as you can 
> guess I have a problem using it.
> Don't know what I'm doing wrong, so here is the code:

There is a serious bug with NativeFSLockFactory as it now stands -- it's
precisely the issue you've come across: different directories end up
incorrectly sharing the same lock file.  I am working on the fix and will
re-submit the patch soon.  Sorry about this.

Mike

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



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


Re: NativeFSLockFactory problem

Posted by Michael McCandless <lu...@mikemccandless.com>.
Frank Kunemann wrote:
>  
> Hi all,
> 
> I'm trying to use the new class NativeFSLockFactory, but as you can guess I
> have a problem using it.
> Don't know what I'm doing wrong, so here is the code:

There is a serious bug with NativeFSLockFactory as it now stands --
it's precisely the issue you've come across: different directories end
up incorrectly sharing the same lock file.  I am working on the fix
and will re-submit the patch soon.  Sorry about this.

Mike

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