Differences between revisions 6 and 7
Revision 6 as of 2004-06-05 14:30:55
Size: 982
Editor: ad7-m159
Comment:
Revision 7 as of 2009-09-20 21:47:45
Size: 982
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Lucene <= 1.2 creates .lock files in the index directory itself. With >= 1.3 it creates it in java.io.tmpdir (usually /tmp on *NIX systems).

If you get the Exception:

java.io.IOException: Lock obtain timed out

  • at org.apache.lucene.store.Lock.obtain(Lock.java:97) at org.apache.lucene.store.Lock$With.run(Lock.java:147)

    at org.apache.lucene.index.IndexReader.open(IndexReader.java:110) at org.apache.lucene.search.IndexSearcher.<init>(IndexSearcher.java:80)

This is because Lucene was unable to open the index becuase it's currently locked.

Note that on Tomcat locks are kept in TOMCAT_HOME/temp and this can become confusing because if you check /tmp there are no lock files.

You can also pass lucene a system property to increase the commit/write lock timeout interval, like so:

-Dorg.apache.lucene.commitLockTimeout=60000

or

-Dorg.apache.lucene.writeLockTimeout=60000

The above sets the timeout to one minute.

LockObtainTimedOut (last edited 2009-09-20 21:47:45 by localhost)