I see. So two questions:

1) Is it ok for prepareCommit() to call ensureOpen(false)? In LUCENE-4575 I
consolidate the two prepCommit() and this is the only way it would work ...

2) Could you perhaps clarify the use of the second argument in the
javadocs? Maybe also rename it to something like "fail if closing"? The
name "includePendingClose" is vague perhaps consider*?)

Thanks anyway for clarifying this !

Shai

On Fri, Nov 30, 2012 at 1:57 PM, Michael McCandless <
luc...@mikemccandless.com> wrote:

> On Thu, Nov 29, 2012 at 3:31 PM, Shai Erera <ser...@gmail.com> wrote:
> >
> > Hi
> >
> > While working on LUCENE-4575 I noticed what I thought was an
> inconsistency between prepareCommit() and prepareCommit(commitData).
> > The former called ensureOpen(true) and the latter ensureOpen(false). At
> first I thought that this is a bug, so I fixed both to call
> ensureOpen(true),
> > especially now that I consolidate the two prepCommit() versions into
> one, but then all tests failed with AlreadyClosedException. How wonderful
> :).
> >
> > Getting deeper into the meaning of the two ensureOpen versions i realize
> that the boolean means something like "fail if IW has been closed, or is
> > in the process of closing). Some methods choose to not fail if IW is in
> the process of closing, while others do (mostly internal methods).
> >
> > My question is - why make the distinction? If IW is in the process of
> closing, why not always fail?
>
> Because IW will call some of these methods during close (eg it commits
> before closing)...
>
> If we fix close to not commit (there is an issue for this...) then we
> could likely remove this boolean.
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: dev-h...@lucene.apache.org
>
>

Reply via email to