[
https://issues.apache.org/jira/browse/SOLR-9116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jessica Cheng Mallet updated SOLR-9116:
---------------------------------------
Description:
Fix a leak of SolrIndexSearcher when a SolrCore is reloaded. Added a test to
expose this leak when run in many iterations (pretty reliable failure with
iters=1K), which passes with the fix (ran iters=10K twice).
The fundamental issue is that when an invocation of SolrCore#openNewSearcher is
racing with SolrCore#close, if this synchronized block
(https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/core/SolrCore.java#L1611)
in openNewSearcher doesn't check for whether or not the core is closed, it can
possibly run after the core runs closeSearcher and assign the newly constructed
searcher to realtimeSearcher again, which will never be cleaned up. The fix is
to check if the SolrCore is closed inside the synchronized block, and if so,
clean up the newly constructed searcher and throw an Exception.
was:
Fix a leak of SolrIndexSearcher when a SolrCore is reloaded. Added a test to
expose this leak when run in many iterations (pretty reliable failure with
iters=1K), which passes with the fix (ran iters=10K twice).
The fundamental issue is that when an invocation of SolrCore#openNewSearcher is
racing with SolrCore#close, if this synchronized block
(https://github.com/apache/lucene-solr/blob/master/solr/
core/src/java/org/apache/solr/core/SolrCore.java#L1611) in openNewSearcher
doesn't check for whether or not the core is closed, it can possibly run after
the core runs closeSearcher and assign the newly constructed searcher to
realtimeSearcher again, which will never be cleaned up. The fix is to check if
the SolrCore is closed inside the synchronized block, and if so, clean up the
newly constructed searcher and throw an Exception.
> Race condition causing occasional SolrIndexSearcher leak when SolrCore is
> reloaded
> ----------------------------------------------------------------------------------
>
> Key: SOLR-9116
> URL: https://issues.apache.org/jira/browse/SOLR-9116
> Project: Solr
> Issue Type: Bug
> Reporter: Jessica Cheng Mallet
> Labels: leak, searcher
> Attachments: SOLR-9116.patch
>
>
> Fix a leak of SolrIndexSearcher when a SolrCore is reloaded. Added a test to
> expose this leak when run in many iterations (pretty reliable failure with
> iters=1K), which passes with the fix (ran iters=10K twice).
> The fundamental issue is that when an invocation of SolrCore#openNewSearcher
> is racing with SolrCore#close, if this synchronized block
> (https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/core/SolrCore.java#L1611)
> in openNewSearcher doesn't check for whether or not the core is closed, it
> can possibly run after the core runs closeSearcher and assign the newly
> constructed searcher to realtimeSearcher again, which will never be cleaned
> up. The fix is to check if the SolrCore is closed inside the synchronized
> block, and if so, clean up the newly constructed searcher and throw an
> Exception.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]