lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (Updated) (JIRA)" <>
Subject [jira] [Updated] (LUCENE-3644) problems with IR's readerFinishedListener
Date Tue, 13 Dec 2011 19:22:30 GMT


Robert Muir updated LUCENE-3644:

    Attachment: LUCENE-3644.patch

But: I don't think we should "forward to subs" when someone registers for reader closed? I
think if you register you should only be notified when that exact reader is closed?

I agree, the only two real uses of this api we have today (as of the previous patch), both
jump thru hoops to avoid this. Here's a patch implementing it that way (much cleaner imo)
> problems with IR's readerFinishedListener
> -----------------------------------------
>                 Key: LUCENE-3644
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Robert Muir
>             Fix For: 3.6, 4.0
>         Attachments: LUCENE-3644.patch, LUCENE-3644.patch, LUCENE-3644.patch
> There are two major problems:
> 1. The listener api does not really apply all indexreaders. for example segmentreaders
dont fire it on close, only segmentcorereaders. this is wrong, a segmentcorereader is *not*
an indexreader. Furthermore, if you register it on a top-level reader you get events for anything
under the reader tree (sometimes, unless they are segmentreaders as mentioned above, where
it doesnt work correctly at all).
> 2. Furthermore your listener is 'passed along' in a viral fashion from clone() and reopen().
This means for example, if you are trying to listen to readers in NRT search you are just
accumulating reader listeners, all potentially keeping references to old indexreaders (because,
in order to deal with #1 your listener must 'keep' a reference to the IR it was registered
on, so it can check if thats *really* the one).
> We should discuss how to fix #1. 
> I will create a patch for #2 shortly and commit it, its just plain wrong.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message