Le 6 août 2011 à 19:52, Yonik Seeley a écrit :

>> I've been using the following:
>>   rb.req.getCore().getSearcher().get().getReader()
> 
> Bingo!  Code should never do core.getSearcher().get()
> since core.getSearcher returns a reference that must be decremented
> when you are done.
> 
> Using req.getSearcher() is much easier since it ensures that the
> searcher never changes during the scope of a single request
> and it handles decrementing the reference when the request is closed.

When you say "decrementing" you do also mean dereference?
(seems to be from the RefCounted class which would dereference when ref-count 
is zero)

I also see the javadoc of SolrCore.getSearcher() is quite explicit there.

I would suggest to add a display of the closed-ness-status of the reader in the 
stats.jsp.
Most likely all these searchers have a closed reader and one would see the bug.

paul

Reply via email to