Le 6 août 2011 à 17:37, Yonik Seeley a écrit : >> I have a custom query-handler and a custom response writer. > > Do you always retrieve the searcher via > SolrQueryRequest.getSearcher()? If so, there should be no problem... > but if you call SolrCore.getSearcher(), that is where leaks can happen > if you don't decref the reference returned.
I've been using the following: rb.req.getCore().getSearcher().get().getReader() inside query transforming methods. That seems to be exactly what req.getSearcher() does which I had not noticed. Is there a difference. >> I also use the velocity response-writer (for debug purposes). >> None store a searcher or params, I believe. >> >> I have a query in the query handler that is a thread-local (it's a large >> "preferring" query that I add to every query). Could this be the reason? > > As long as it's a normal query that has not been rewritten or > weighted, it should have no state tied to any particular > reader/searcher and you should be fine. How would I know if it gets rewritten or weighted? Does something write to these queries somehow so that the reference to the searcher would be held? paul