lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject Re: IndexReader.removeReaderClosedListener
Date Wed, 20 Aug 2014 15:10:09 GMT
I don't understand something -- you add a ReaderClosedListener to get a
notification when IR.close() is called (actually, when it's actually being
closed). Why removing the listener after the reader has been closed? Don't
apps usually nullify their IR member after it's been closed?

Shai


On Wed, Aug 20, 2014 at 5:51 PM, Phil Herold <pherold@nc.rr.com> wrote:

> Fine. I'm sure you've got a good reason for this. But it is totally
> un-intuitive, and introduces a potential memory leak, IMO. The
> implementation of this pattern is definitely different than just about any
> other library I can think of.
>
> Given that having a listener for index closed doesn't really solve the
> issue I was having that I was hoping it would, it doesn't much matter to me
> at this point.
>
> Thanks.
>
> --
> Phil
>
>
> On Wed, Aug 20, 2014 at 8:37 AM, Robert Muir <rcmuir@gmail.com> wrote:
>
>> 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 <pherold@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 <uwe@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: uwe@thetaphi.de
>> >>
>> >>
>> >> > -----Original Message-----
>> >> > From: Michael McCandless [mailto:lucene@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.phil@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-unsubscribe@lucene.apache.org For
>> additional
>> >> > commands, e-mail: dev-help@lucene.apache.org
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> >> For additional commands, e-mail: dev-help@lucene.apache.org
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>>
>

Mime
View raw message