Jason Polites wrote:
Hi all,
When indexing with multiple threads, and under heavy load, I get the
following exception:
java.io.IOException: Access is denied
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:850)
at org.apache.lucene.store.FSDirectory$1.obtain(FSDirectory.java:363)
at org.apache.lucene.store.Lock.obtain(Lock.java:63)
I am using the Compass framework from Open Symphony, however this simply
sits on top of Lucene and the folks at Open Symphony have assured me that
the access to Lucene indexes within their framework is appropriately
synchronized. In either case, I would have thought Lucene should be
managing its locks regardless of how the indexes are accessed (within the
same JVM at least).
Are you also running searchers against this index? Are they re-init'ing
frequently or being opened and then held open?
This looks similar to http://issues.apache.org/jira/browse/LUCENE-665
(that was just opened) as well as other issues in the past, but in these
cases there are usually also IndexReaders/Searchers against the index.
Could you try the patch to FSDirectory.java (in that issue) and see if
it helps?
There is a bug report on the Sun website for this issue:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6325169
I think that bug is probably a different issue.
Should the line "lockFile.createNewFile();" be within some form of
synchronizion block?
Good question ... however, in your use case (the commits that
IndexWriter is doing) the code above Lock.obtain is already
synchronized(directory) so it's only one thread that can make it down
into the Lock.obtain method. So I don't believe adding synchronization
in this method will help you.
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]