Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 68653 invoked from network); 2 Nov 2009 10:35:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Nov 2009 10:35:45 -0000 Received: (qmail 57303 invoked by uid 500); 2 Nov 2009 10:35:43 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 57224 invoked by uid 500); 2 Nov 2009 10:35:42 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 57214 invoked by uid 99); 2 Nov 2009 10:35:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 10:35:42 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of anshumg@gmail.com designates 209.85.216.187 as permitted sender) Received: from [209.85.216.187] (HELO mail-px0-f187.google.com) (209.85.216.187) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 10:35:34 +0000 Received: by pxi17 with SMTP id 17so1070755pxi.20 for ; Mon, 02 Nov 2009 02:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=5VMz7YAeFVuAj4ZwBGOefgZ0f1QnSgEXdOxYdk/5jhM=; b=YchDTZdgOUOLH7+0OoKAYYTjcq/P2EFz6P+iDGXwrV84iouO7y8BRqiS9XXaZtBjdO Uh/l0oiQebgySUuFf83Z5aqhenargVVUz300IK9BaHIj2ZbfDwgIu2GUQLJo+TsCNDi6 Jh+nPf621/HZc4zDPvGsZ9DpdUHPDbRozlEUI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=VCGGXA+i7LZD4PdRopz0QAp4DKDu7INf9YkSAsLtxrenEL1TxuKqweSFJXYOGmQ3HQ UXjjMDXZcQr+MhNQDV8PI3jHXlB9isAYy+5D1EN+/YyjHVTzKaAmBBWoEcoMjZ8E99d3 Cqo8eG0mRsZEIQKjLHvBBqgpHvq10EqmGELLo= MIME-Version: 1.0 Received: by 10.114.6.25 with SMTP id 25mr8057455waf.25.1257158113195; Mon, 02 Nov 2009 02:35:13 -0800 (PST) In-Reply-To: <825560167.111257157215699.JavaMail.root@mail.uk.scalix.com> References: <825560167.111257157215699.JavaMail.root@mail.uk.scalix.com> From: Anshum Date: Mon, 2 Nov 2009 16:04:53 +0530 Message-ID: <867513fe0911020234o16ab183aue87886766e5d7ad8@mail.gmail.com> Subject: Re: LockObtainFailedException To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=0016e648bcbec381b6047760ee4e X-Virus-Checked: Checked by ClamAV on apache.org --0016e648bcbec381b6047760ee4e Content-Type: text/plain; charset=ISO-8859-1 Is that a part of some regular process? as in the tomcat shutdown? if it is, could you pass a shutdown signal to the search daemon/service and then get it to close the already opened writers. Also if its the service that causes the exception, add a writer.close statement to the finally block (add that if that's not already in place). That should solve the problem. -- Anshum Gupta Naukri Labs! http://ai-cafe.blogspot.com The facts expressed here belong to everybody, the opinions to me. The distinction is yours to draw............ On Mon, Nov 2, 2009 at 3:50 PM, Chris Bamford wrote: > Hi Anshum, > > Yes there is a reply, but it is Solr specific :-) > I understand that I can catch the exception, but then what can I do about > it when it occurs? In my case I am pretty sure that the 'write.lock' file > is stale - most probably left from the last time Tomcat shut down - so I > want to force it to be opened. How can I do that? Am I obliged to locate > the file and remove it myself before attempting to repeat the open() - or is > there something in the API to help? > > Thanks > > - Chris > > ----- Original Message ----- > From: Anshum > Sent: Mon, 11/2/2009 10:08am > To: java-user@lucene.apache.org > Subject: Re: LockObtainFailedException > > Hi Chris, > > Isn't there a reply @ the older thread? > In case there isn't, this is generally observed when an indexwriter is not > closed properly i.e. just not closed. > The lock is created on opening the indexwriter to maintain the sanity of > the > index. This lock gets removed on closing writer.close(). In case of > exceptions, when the indexwriter.close() is not closed, the subsequent call > to an index operation (opening a writer) would result in a > lockobtainfailedexception. > Try using a finally block to handle such cases. > > -- > Anshum Gupta > Naukri Labs! > http://ai-cafe.blogspot.com > > The facts expressed here belong to everybody, the opinions to me. The > distinction is yours to draw............ > > > On Mon, Nov 2, 2009 at 3:27 PM, Chris Bamford >wrote: > > > Hi, > > > > I was researching LockObtainFailedExceptions and came across this thread. > > I > > don't use Solr, just regular Lucene deployed via Tomcat - but I have > > started getting these exceptions which coincides with our recent > > upgrade from 2.0.0 to 2.4.0. > > I have found that just removing the lock file > > seems to clear up the problem, but I was hoping for (a) a better > > understanding of why they might occur in the first place and (b) some > > thoughts on how I might deal with them programatically. > > > > Thanks for any ideas / pointers, > > > > - Chris > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --0016e648bcbec381b6047760ee4e--