Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 66101 invoked from network); 6 Nov 2004 00:35:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Nov 2004 00:35:36 -0000 Received: (qmail 45365 invoked by uid 500); 6 Nov 2004 00:35:29 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 45336 invoked by uid 500); 6 Nov 2004 00:35:29 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 45321 invoked by uid 99); 6 Nov 2004 00:35:28 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=FROM_ENDS_IN_NUMS,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [216.148.212.186] (HELO w04.bloglines.com) (216.148.212.186) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 05 Nov 2004 16:35:27 -0800 Received: (qmail 4433 invoked by uid 99); 6 Nov 2004 00:35:26 -0000 Message-ID: <1099701326.1163493923.4432.sendItem@bloglines.com> Date: 6 Nov 2004 00:35:26 -0000 From: yahootintin.1247688@bloglines.com To: lucene-user@jakarta.apache.org Subject: Re: Locks and Readers and Writers MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Ok, I simplified my test case a little... I removed the UNC share which is a remote file share that Windows supports. I have two processes running on the same Windows XP machine. 1) The first process uses an IndexWriter to writes to the index and then closes the IndexWriter. 2) The first process sends a multicast event to the other process. 3) The other process opens an IndexReader. 4) Meanwhile, the first process tries to open the index again to do a write. 5) Often the IndexWriter gets an error: Lock obtain timed out Any advice? Is this only a problem on Windows? Here's the stack trace: java.io.IOException: Lock obtain timed out: Lock@C:\WINDOWS\TEMP\lucene-9906f192fb41cc8775cf839213997b7e-commit.lock at org.apache.lucene.store.Lock.obtain(Lock.java:58) at org.apache.lucene.store.Lock$With.run(Lock.java:108) at org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:501) at org.apache.lucene.index.IndexWriter.maybeMergeSegments(IndexWriter.java:458) at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:310) --- Lucene Users List" > Hi Christoph, > > > > Thats what I thought. But what I'm seeing is this: > > - open > > reader for searching > > (the reader is opening an index on a remote machine > > (via UNC) which takes a couple seconds) > > - meanwhile the other service opens > > an IndexWriter and adds a document > > (the index writer determines that it needs > > to merge so it tries to get a lock. since the reader is still opening, the > > IO exception is thrown) > > > > I believe that increasing the merge factor will > > reduce the opportunity for this to occur. But it will still occur at some > > point. > > > I'm not sure what you mean by `opening an index on a remote machine (via > UNC)' but have you made sure that lock files are put in the same directory > for both processes (see the mailing list archive for details)? > Also note, that lucene's locking is known not to work on NFS (also see the > list archive). I don't know if it works on SMB mounts. > > Morus > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org