Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 28346 invoked from network); 30 Sep 2009 00:59:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Sep 2009 00:59:18 -0000 Received: (qmail 30319 invoked by uid 500); 30 Sep 2009 00:59:17 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 30240 invoked by uid 500); 30 Sep 2009 00:59:17 -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 30232 invoked by uid 99); 30 Sep 2009 00:59:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Sep 2009 00:59:17 +0000 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 [208.69.42.181] (HELO radix.cryptio.net) (208.69.42.181) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Sep 2009 00:59:08 +0000 Received: by radix.cryptio.net (Postfix, from userid 1007) id 4F70A71C882; Tue, 29 Sep 2009 17:58:46 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by radix.cryptio.net (Postfix) with ESMTP id 4D24971C883 for ; Tue, 29 Sep 2009 17:58:46 -0700 (PDT) Date: Tue, 29 Sep 2009 17:58:45 -0700 (PDT) From: Chris Hostetter To: java-dev@lucene.apache.org Subject: Re: Lucene 2.9.0-rc5 : Reader stays open after IndexWriter.updateDocument(), is that possible? In-Reply-To: <4AC0E375.8010301@lexum.umontreal.ca> Message-ID: References: <4ABCE028.5040300@lexum.umontreal.ca> <4ABCE1C8.7080807@gmail.com> <4ABCE4AF.1090306@lexum.umontreal.ca> <111A1389824F45B297BF5A901EF24E2E@VEGA> <4ABF7B81.3080304@gmail.com> <4ABF9CD0.6030501@gmail.com> <4AC0E375.8010301@lexum.umontreal.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : However, they may be something with the fact that Lucene's Analyzers : automatically close the reader when its done analyzing. I think this : encourages people not to explicitly close them, and creates the potential of : having open fd's if an exception is thrown in the middle of the analysis or : before addDocument/updateDocument is called. It's always been the case that users should close their own Readers -- lucene's docs have never indicated that they will close hte reader for you, it's just a helpful side effect that once IndexWRiter has consumed all hte chars from a Reader it calls close() -- the caller should still close() explicitly for precisely the reasons you listed, but there's really no downside to multiple close calls. even if we werent' worried about breaking existing client code (where people never call close themselves) it would still be a good idea to leave the close() calls in because the sooner the Readers are closed the sooner the descriptor can be released -- no reason to wait (ie: during a serialized merge for example) until addDocument is done if hte Reader has been completley exhausted. -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org