Index: FSDirectory.java =================================================================== RCS file: /home/cvspublic/jakarta-lucene/src/java/org/apache/lucene/store/FSDirectory.java,v retrieving revision 1.26 diff -u -r1.26 FSDirectory.java --- FSDirectory.java 29 Mar 2004 22:48:05 -0000 1.26 +++ FSDirectory.java 9 May 2004 11:30:50 -0000 @@ -290,7 +290,7 @@ // create a lock file final File lockFile = new File(lockDir, buf.toString()); - return new Lock() { + return new Lock(lockFile) { public boolean obtain() throws IOException { if (DISABLE_LOCKS) return true; Index: Lock.java =================================================================== RCS file: /home/cvspublic/jakarta-lucene/src/java/org/apache/lucene/store/Lock.java,v retrieving revision 1.8 diff -u -r1.8 Lock.java --- Lock.java 29 Mar 2004 22:48:05 -0000 1.8 +++ Lock.java 9 May 2004 11:30:50 -0000 @@ -18,6 +18,7 @@ import org.apache.lucene.index.IndexWriter; +import java.io.File; import java.io.IOException; /** An interprocess mutex lock. @@ -35,7 +36,15 @@ */ public abstract class Lock { public static long LOCK_POLL_INTERVAL = 1000; + private File lockFile = null; + + Lock(File lockFile) { + this.lockFile = lockFile; + } + Lock() { + } + /** Attempts to obtain exclusive access and immediately return * upon success or failure. * @return true iff exclusive access is obtained @@ -55,7 +64,11 @@ int sleepCount = 0; while (!locked) { if (++sleepCount == maxSleepCount) { - throw new IOException("Lock obtain timed out"); + String s = "Lock obtain timed out"; + if (lockFile != null) { + s += ", lock file =" + lockFile.getAbsolutePath(); + } + throw new IOException(s); } try { Thread.sleep(LOCK_POLL_INTERVAL); Index: RAMDirectory.java =================================================================== RCS file: /home/cvspublic/jakarta-lucene/src/java/org/apache/lucene/store/RAMDirectory.java,v retrieving revision 1.14 diff -u -r1.14 RAMDirectory.java --- RAMDirectory.java 20 Apr 2004 18:27:55 -0000 1.14 +++ RAMDirectory.java 9 May 2004 11:30:51 -0000 @@ -18,7 +18,6 @@ import java.io.IOException; import java.io.File; -import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; @@ -115,8 +114,7 @@ /** Set the modified time of an existing file to now. */ public void touchFile(String name) throws IOException { // final boolean MONITOR = false; - int count = 0; - + RAMFile file = (RAMFile)files.get(name); long ts2, ts1 = System.currentTimeMillis(); do {