Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 36698 invoked from network); 9 Nov 2007 16:47:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Nov 2007 16:47:49 -0000 Received: (qmail 20626 invoked by uid 500); 9 Nov 2007 16:47:34 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 20593 invoked by uid 500); 9 Nov 2007 16:47:34 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 20582 invoked by uid 99); 9 Nov 2007 16:47:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2007 08:47:34 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.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 16:47:38 +0000 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id CC461468E1 for ; Fri, 9 Nov 2007 11:47:17 -0500 (EST) Received: from web8.messagingengine.com ([10.202.2.217]) by compute1.internal (MEProxy); Fri, 09 Nov 2007 11:47:17 -0500 Received: by web8.messagingengine.com (Postfix, from userid 99) id B4BF142CE0; Fri, 9 Nov 2007 11:47:17 -0500 (EST) Message-Id: <1194626837.9696.1220464575@webmail.messagingengine.com> X-Sasl-Enc: xL6KpdTpaHkc/2cysMzAgrLY/dr9vghbo/X6B97Qwlhx 1194626837 From: "Michael McCandless" To: java-dev@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 Subject: Fwd: Re: - lock improvement suggestion Date: Fri, 09 Nov 2007 11:47:17 -0500 X-Virus-Checked: Checked by ClamAV on apache.org Are there any objections to adding "throws LockReleaseFailedException" to Lock.release, and subclassing that exception from IOException? I think this is a very minor break in backwards compatibility, because all places that call Lock.release in Lucene already throw IOException themselves. The only other option I can see, as Nikolay suggests below, is to subclass from RuntimeException, but I don't think that's very clean and really the source of the issue (failed to delete the lock file) is really most like an IOException. Mike "Nikolay Diakov" wrote: > I see you do the wrapping in a RuntimeException trick. Perhaps you can > introduce a special exception derived from RuntimeException that you > would throw in that case. It would basically mean "The underlying FS > does something we cannot tolerate so we fail fast." > > --Nikolay > > Michael McCandless wrote: > > 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 > > > > --------------------------------------------------------------------- > 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-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org