Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 73449 invoked from network); 7 Mar 2009 02:01:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Mar 2009 02:01:51 -0000 Received: (qmail 1869 invoked by uid 500); 7 Mar 2009 02:01:43 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 1836 invoked by uid 500); 7 Mar 2009 02:01:43 -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 1824 invoked by uid 99); 7 Mar 2009 02:01:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Mar 2009 18:01:43 -0800 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 erickerickson@gmail.com designates 209.85.162.182 as permitted sender) Received: from [209.85.162.182] (HELO el-out-1112.google.com) (209.85.162.182) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Mar 2009 02:01:34 +0000 Received: by el-out-1112.google.com with SMTP id s27so489886ele.14 for ; Fri, 06 Mar 2009 18:01: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 :date:message-id:subject:from:to:content-type; bh=eorBCUGIFjFQRUpAPtp7zBz1OoWveYXl6Z75apEH+N0=; b=ep/gEaT5zU4J6Rz5U7H5n8c9/wSdWIR2dyvN+Yo9RpJKmlMHzJ9i6HGl881/7Gyj4c hkygNIdCdK6lIQRSmfd4eC7qkc6ZEwyw6c0qm4Da6slxHwZ1Wa970ONIV1ZeRoO8KEfy 7jRJgqKEGXEcEQZDrcBGTpomlocUj26ADmNdc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ryFOtcyv9JaM0XNB7p7G/L7GHlBHnVcifO/YYgiBFdlg7n03FvOMfv/tngOfQaQljD hzrsEjMIVq1ejg6rHqAoDxdi6DnXZLuIswtu3shImlq/ln+ePAf+xd1lWJC4q5OGnbOK +jWzilM/QP5UpdqF6m1Q0+DBPofH7IkBuUXns= MIME-Version: 1.0 Received: by 10.220.72.200 with SMTP id n8mr1116723vcj.16.1236391273037; Fri, 06 Mar 2009 18:01:13 -0800 (PST) In-Reply-To: <72EC0B95-764B-4A06-A99D-1EC3D22B9DD8@mikemccandless.com> References: <28511746.1236353754628.JavaMail.root@elwamui-milano.atl.sa.earthlink.net> <714CF382-5702-48CF-A438-935B944E4DCF@mikemccandless.com> <359a92830903060917i3a4ca92ag37db313fd01c2161@mail.gmail.com> <359a92830903061305u6699ec21k8f52ce2cf81e3b12@mail.gmail.com> <72EC0B95-764B-4A06-A99D-1EC3D22B9DD8@mikemccandless.com> Date: Fri, 6 Mar 2009 21:01:12 -0500 Message-ID: <359a92830903061801v931e9e9q8450aaa6ec05071b@mail.gmail.com> Subject: Re: deletion of index-files fails From: Erick Erickson To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=0016363b872ca1ff4b04647dc61a X-Virus-Checked: Checked by ClamAV on apache.org --0016363b872ca1ff4b04647dc61a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit OK, I understand now. Like I said, anything you deem appropriate. Best Erick On Fri, Mar 6, 2009 at 5:45 PM, Michael McCandless < lucene@mikemccandless.com> wrote: > If we changed the signature (return value) then on dropping in the JAR > you'd have to recompile your code, which violates our back compat goals, ie > "drop in JAR and run". > > Mike > > > Erick Erickson wrote: > > Why would it break back compat? >> They just return void now, so >> >> IndexReader.incRef(); >> >> should still compile/run. >> >> But that's arguing about angels dancing on pins. My real issue >> is that by not allowing *some* mechanism to get the refcount >> developers don't have any tools for figuring out that it's a refcount >> issue, >> so exposing getRefCount() would satisfy that need. >> >> I'll totally defer to folks who actually maintain code to >> cast the deciding ballot. >> >> Best >> Erick >> >> On Fri, Mar 6, 2009 at 2:10 PM, Michael McCandless < >> lucene@mikemccandless.com> wrote: >> >> >>> Yes ref counts are tricky, though these are expert APIs. >>> >>> I think changing close, incRef, decRef to return the RC would be good, >>> though that breaks back compat. >>> >>> How about exposing getRefCount() instead? >>> >>> Mike >>> >>> >>> Erick Erickson wrote: >>> >>> Hmmmm, reference counting is always yucky. I looked >>> >>>> the IndexReader javadocs over and there isn't any help >>>> there for managing refcounts. You can't find the current >>>> refcount, close doesn't indicate the results, etc. Or I >>>> missed, for the Nth time, perfectly obvious documentation. >>>> >>>> What do people think about one or more of these options? >>>> 1> have IndexReader.close() return some indication >>>> of what the resulting refcount is. I.e. "did the reader >>>> *really* close. >>>> 2> have decRef do the same. >>>> 3> have incRef do the same (although this seems less useful). >>>> >>>> >>>> It's really, really hard to insure your reference counting is >>>> correct solely by code inspection ! >>>> >>>> yeah, yeah, yeah, this probably belongs on the dev list. >>>> I'll be happy to put it over there and/or raise a JIRA... >>>> >>>> Best >>>> Erick >>>> >>>> On Fri, Mar 6, 2009 at 11:40 AM, Michael McCandless < >>>> lucene@mikemccandless.com> wrote: >>>> >>>> >>>> OK, phew! Thanks for bringing closure. >>>>> >>>>> Mike >>>>> >>>>> >>>>> rolarenfan@earthlink.net wrote: >>>>> >>>>> I did just now double/triple-check: the IndexWriter is definitely >>>>> closed. >>>>> >>>>> >>>>>> However (cough), I did have a bogus call to IndexReader.incRef() ... >>>>>> once >>>>>> I removed that, the call to IndexReader.close() actually worked and >>>>>> then >>>>>> the >>>>>> deletion did so too. Thanks; sorry to trouble you. >>>>>> >>>>>> -Paul >>>>>> >>>>>> -----Original Message----- >>>>>> >>>>>> From: Michael McCandless >>>>>> >>>>>>> Sent: Mar 6, 2009 4:23 AM >>>>>>> To: java-user@lucene.apache.org >>>>>>> Cc: rolarenfan@earthlink.net >>>>>>> Subject: Re: deletion of index-files fails >>>>>>> >>>>>>> >>>>>>> If truly the IndexWriter & all IndexReaders are closed, then they >>>>>>> should no longer be holding open files. Maybe triple check that >>>>>>> you've indeed closed everything. >>>>>>> >>>>>>> It's remotely possible that some other process (virus checker, source >>>>>>> control clients, etc) has the file open. >>>>>>> >>>>>>> You could try Microsoft's (formerly sysinternals) "Process Monitor" >>>>>>> to >>>>>>> see which processes have the files open. >>>>>>> >>>>>>> Mike >>>>>>> >>>>>>> Ian Lea wrote: >>>>>>> >>>>>>> What OS are you running? What version of lucene? Are you sure that >>>>>>> >>>>>>> you have privilege to delete the files that it is failing on? That >>>>>>>> they are part of the index you are trying to remove? That something >>>>>>>> else doesn't have the files open? >>>>>>>> >>>>>>>> It seems likely that you are on Windows and that something is >>>>>>>> holding >>>>>>>> on to the files. I believe that Windows won't let you delete open >>>>>>>> files. You could try calling File.deleteOnExit() for the index >>>>>>>> files. >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Ian. >>>>>>>> >>>>>>>> >>>>>>>> On Fri, Mar 6, 2009 at 2:19 AM, wrote: >>>>>>>> >>>>>>>> So, I have a (small) Lucene index, all fine; I use it a bit, and >>>>>>>> >>>>>>>>> then (on app shutdown) want to delete its files and the containing >>>>>>>>> directory (the index is intended as a temp object). At some earlier >>>>>>>>> time this was working just fine, using java.io.File.delete(). Now >>>>>>>>> however, some of the files get deleted (segments*) whereas others >>>>>>>>> fail (no Exn is thrown, just java.io.File.delete() returns false: >>>>>>>>> _0.cfs, _0.cfx). I've tried closing the IndexReader (no IndexWriter >>>>>>>>> exists at shutdown), but that makes no diff. >>>>>>>>> >>>>>>>>> Any ideas? >>>>>>>>> >>>>>>>>> thanks >>>>>>>>> Paul >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> --------------------------------------------------------------------- >>>>>>>>> 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-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 > > --0016363b872ca1ff4b04647dc61a--