lucene-dev mailing list archives

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


Michael McCandless commented on LUCENE-1707:

Patch looks good; thanks Shai!

bq. Why is it volatile then? 

Good question.  Only the ctor (which I believe is fine) and ensureOpen() access it un-synchronized,
so I think we should make it un-volatile; I'll change it before committing.

bq. What good does "not hiding that bug" do?

EG, say we're working on SegmentReader an accidentally create a bug that sometimes over decRefs.
By no longer throwing an exception on close (with this change) unit tests might happily pass
when previously they would fail and the bug could go undetected for longer.  (Hopefully some
tests would still catch the bug, but maybe not).  I think catching a bug sooner rather than
later is better.

Calling close many times is allowed (not a bug), and we handle that by only doing one decRef.
 But too many calls to decRef is a real bug and I think we shouldn't mask/delay it.

> 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