I don't agree. Operations like this shouldnt be performed on closed readers.
the ensureOpen is correct. On Wed, Aug 20, 2014 at 8:27 AM, Phil Herold <pher...@nc.rr.com> wrote: > Bingo. ensureOpen() should not be called from this method. Thanks. > > -- > Phil > > > > On Wed, Aug 20, 2014 at 4:55 AM, Uwe Schindler <u...@thetaphi.de> wrote: >> >> Hi, >> >> In my opinion, removing the listener before close looks wrong. Because you >> would not get the listener events for the explicit close of the >> DirectoryReader. >> >> I would just remove the ensureOpen(). We should open issue. >> >> Uwe >> ----- >> Uwe Schindler >> H.-H.-Meier-Allee 63, D-28213 Bremen >> http://www.thetaphi.de >> eMail: u...@thetaphi.de >> >> >> > -----Original Message----- >> > From: Michael McCandless [mailto:luc...@mikemccandless.com] >> > Sent: Wednesday, August 20, 2014 9:53 AM >> > To: Lucene/Solr dev; Phil Herold >> > Subject: Re: IndexReader.removeReaderClosedListener >> > >> > Hmm, you should call this method before closing the IndexReader, to >> > remove a listener you previously added. >> > >> > Mike McCandless >> > >> > http://blog.mikemccandless.com >> > >> > >> > On Tue, Aug 19, 2014 at 11:27 AM, Phil Herold <herold.p...@gmail.com> >> > wrote: >> > > The implementation of this final method (latest 4.9 code) calls >> > > ensureOpen(), which fails, since the reader is closed. As a result, >> > > this method doesn't work. It seems as if this is therefore a potential >> > > memory leak, not being able to remove the listener. Or am I missing >> > something? >> > > >> > > -- >> > > Phil >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional >> > commands, e-mail: dev-h...@lucene.apache.org >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org >> For additional commands, e-mail: dev-h...@lucene.apache.org >> > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org