Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 78990 invoked from network); 25 Aug 2004 10:00:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Aug 2004 10:00:08 -0000 Received: (qmail 16033 invoked by uid 500); 25 Aug 2004 09:59:59 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 15974 invoked by uid 500); 25 Aug 2004 09:59:58 -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 15957 invoked by uid 99); 25 Aug 2004 09:59:58 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [62.95.90.145] (HELO mail.polopoly.com) (62.95.90.145) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 25 Aug 2004 02:59:55 -0700 Received: from polopoly.com (holmer.intra.polopoly.com [172.31.252.180]) by mail.polopoly.com (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) with ESMTP id i7P9xqm15928 for ; Wed, 25 Aug 2004 11:59:52 +0200 Message-ID: <412C6318.3000705@polopoly.com> Date: Wed, 25 Aug 2004 11:59:52 +0200 From: Claes Holmerson Organization: Polopoly AB User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 X-Accept-Language: sv, en-us, en MIME-Version: 1.0 To: Lucene Users List Subject: Re: Lock handling References: <20040825082848.59195.qmail@web12707.mail.yahoo.com> In-Reply-To: <20040825082848.59195.qmail@web12707.mail.yahoo.com> X-Enigmail-Version: 0.76.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Yes, looking at the time of the lock was an idea I had but I could not find anything like a time stamp. Am I missing something obvious here? Claes Otis Gospodnetic wrote: >Hello, > >If you use Lucene incorrectly (e.g. 2 IndexWriters writing to the same >index), you will see this error. Lucene has no way of telling whether >the lock file was left over from a previous process, or whether it's a >valid lock file because another process is currently indexing documents >or some such. >You could try adding some logic to your app, though. For instance, you >can look at lock's timestamp, and using IndexReader.unlock(...) method >to forcefully unlock the index. > >Otis > >--- Claes Holmerson wrote: > > > >>Hello, >> >>I am interested to hear how people handle locked indexes, for example >> >>when catching an IOException like below. >> >>java.io.IOException: Lock obtain timed out: >>Lock@/tmp/lucene-0b978f2c0aa12e8dcdbd5b0df491bfc4-write.lock >> at org.apache.lucene.store.Lock.obtain(Lock.java:58) >> at >>org.apache.lucene.index.IndexWriter.(IndexWriter.java:223) >> at >>org.apache.lucene.index.IndexWriter.(IndexWriter.java:213) >> >>As far as I can tell, there is no good way to tell whether the lock >>is >>only temporary (working as it should), or if it was created by a >>process >>that later died, and therefore can not remove it. How can I detect >>the >>latter case, and how should I best handle it? >> >>Thanks, >>Claes >> >> >>--------------------------------------------------------------------- >>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 > > > > -- Claes Holmerson Polopoly - Cultivating the information garden Kungsgatan 88, SE-112 27 Stockholm, SWEDEN Direct: +46 8 506 782 59 Mobile: +46 704 47 82 59 Fax: +46 8 506 782 51 claes.holmerson@polopoly.com, http://www.polopoly.com --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org