> Regarding your point about concurrent calls to close() and decref(), I don't
> see how doClose() may be called twice. The `closed` boolean is only used to
> make close() idempotent. Do I miss something?
No, sorry -- you're right, too much looking at this.
> It is just a practical thing for now
On Wed, Mar 28, 2018 at 9:59 AM, Adrien Grand wrote:
> I'd
> still be interested in other opinions regarding whether it would be ok to
> rely more on ByteBufferGuard to have exceptions rather than segfaults when
> reading closed index inputs given that comments say it is only a best
> effort.
>
I
I agree with your points in general. I didn't have the code available to
check when I first replied but it looks like the error message from the
index inputs would be ok if you keep using the reader in another thread.
I'd still be interested in other opinions regarding whether it would be ok
to rel
Also applicable to the general discussion above -- just noticed that
decRef is not synchronized and closed is a regular variable so
doClose() can be called from both close and decRef under a race
condition. I know ref counting is an "expert feature", but I think it
could better agree with close(),
Hi Adrien,
> I'm afraid that always calling doClose would be problematic. If the reader
> is used in another thread then files might get closed under the hood while a
> search is being performed. Even if the guard that we added to MMapDirectory
> would now prevent segfaults, users would get potent
I'm afraid that always calling doClose would be problematic. If the reader
is used in another thread then files might get closed under the hood while
a search is being performed. Even if the guard that we added to
MMapDirectory would now prevent segfaults, users would get potentially
confusing exce
I'm looking at IndexReader.close and keep wondering:
/**
* Closes files associated with this index.
* Also saves any new deletions to disk.
* No other methods should be called after this has been called.
* @throws IOException if there is a low-level IO error
*/
@Override
publi