I'm load testing a webservice which writes to a lucene index.开发者_StackOverflow中文版 If I make the same call repeatedly I get a
org.apache.lucene.store.LockObtainFailedException:
I assume this is because I'm trying to write to an index which is already locked by another thread and that thread waits.
My question is, what is the best way to solve this problem? Do I increase the waiting time or add the write requests to a queue?
Please advise, thanks.
Why do you have multiple writers? IndexWriter is inherently thread-safe; you should have all your threads accessing the same writer. This will get rid of your locking issues.
精彩评论