lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] Commented: (LUCENE-1707) Don't use ensureOpen() excessively in IndexReader and IndexWriter
Date Thu, 25 Jun 2009 18:19:07 GMT


Shai Erera commented on LUCENE-1707:

bq. Patch looks good; thanks Shai! 

Note that decRef() sets closed=true if refCount = 0. This will protect against the other bug
(calling close() then decRef() or vice versa). So if you don't want it there, we should remove
it before committing.

bq. so I think we should make it un-volatile; I'll change it before committing.

If we change refCount to not volatile, is this patch still needed? I.e., what's wrong w/ checking
in ensureOpen if refCount <= 0, same as before?

bq. But too many calls to decRef is a real bug and I think we shouldn't mask/delay it.

That would not be possible, since decRef() asserts refCount > 0 (and asserts are enabled
in tests) and calls ensureOpen(). So calling decRef() twice in a raw would hit either an assert
exception (tests) or ACE (assertions disabled). I think?

> Don't use ensureOpen() excessively in IndexReader and IndexWriter
> -----------------------------------------------------------------
>                 Key: LUCENE-1707
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Shai Erera
>             Fix For: 2.9
>         Attachments: LUCENE-1707.patch, LUCENE-1707.patch
> A spin off from here:
> We should stop calling this method when it's not necessary for any internal Lucene code.
Currently, this code seems to hurt properly written apps, unnecessarily.
> Will post a patch soon

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message