Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 16291 invoked from network); 9 Nov 2007 15:50:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Nov 2007 15:50:49 -0000 Received: (qmail 5704 invoked by uid 500); 9 Nov 2007 15:50:31 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 5526 invoked by uid 500); 9 Nov 2007 15:50:30 -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 5502 invoked by uid 99); 9 Nov 2007 15:50:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2007 07:50:30 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [66.111.4.25] (HELO out1.smtp.messagingengine.com) (66.111.4.25) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2007 15:51:12 +0000 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id C71854659B for ; Fri, 9 Nov 2007 10:50:12 -0500 (EST) Received: from web8.messagingengine.com ([10.202.2.217]) by compute1.internal (MEProxy); Fri, 09 Nov 2007 10:50:12 -0500 Received: by web8.messagingengine.com (Postfix, from userid 99) id A0EDE42C2D; Fri, 9 Nov 2007 10:50:12 -0500 (EST) Message-Id: <1194623412.30050.1220454289@webmail.messagingengine.com> X-Sasl-Enc: amC4QODRsZNRTL35ybEPSiDUgJ+b/3attuheVRzZirN/ 1194623412 From: "Michael McCandless" To: java-user@lucene.apache.org Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface References: <47347A26.5000205@fredhopper.com> Subject: Re: - lock improvement suggestion In-Reply-To: <47347A26.5000205@fredhopper.com> Date: Fri, 09 Nov 2007 10:50:12 -0500 X-Virus-Checked: Checked by ClamAV on apache.org I agree, we should not ignore the return value here. I think throwing an exception if it returns false is the right thing to do? Though, if it's a checked exception, that's not a backwards compatible change... Mike "Nikolay Diakov" wrote: > I have briefly reviewed the SimpleFSLock of Lucene 2.1 and 2.2. I see > that the lock release mechanism does not check the return value of > delete: > > public void release() { > lockFile.delete(); > } > > On most linux-es this can never return false, however under some windows > FS if someone (a virus scanner) touches the file at the proper > (improper) time, one may get a delete failure and get a false value. In > the original code this means that the directory stays locked forever > (unless someone does double unlocking or until a clearLock from the lock > factory). For diagnosting purposes, it may be a good idea to throw an > exception in that case. Alternatively, release() may return a boolean up > the chain, however this may require more changes in the code using the > release(). Just a suggestion. > > Cheers, > Nikolay > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org