You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Joel Bernstein (JIRA)" <ji...@apache.org> on 2016/08/24 00:24:21 UTC

[jira] [Resolved] (SOLR-9406) SolrSuggester should selectively register close hook

     [ https://issues.apache.org/jira/browse/SOLR-9406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joel Bernstein resolved SOLR-9406.
----------------------------------
    Resolution: Resolved

> SolrSuggester should selectively register close hook
> ----------------------------------------------------
>
>                 Key: SOLR-9406
>                 URL: https://issues.apache.org/jira/browse/SOLR-9406
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Suggester
>    Affects Versions: 4.10.3
>            Reporter: Gethin James
>            Assignee: Joel Bernstein
>             Fix For: 6.3
>
>         Attachments: SOLR-9406.patch
>
>
> Currently this is the code for registering a close hook for SolrSuggester:
> {code}
> lookup = factory.create(config, core);
>     core.addCloseHook(new CloseHook() {
>       @Override
>       public void preClose(SolrCore core) {
>         if (lookup != null && lookup instanceof Closeable) {
>           try {
>             ((Closeable) lookup).close();
>           } catch (IOException e) {
>             LOG.warn("Could not close the suggester lookup.", e);
>           }
>         }
>       }
>       
>       @Override
>       public void postClose(SolrCore core) {}
>     });
> {code}
> Notice that the close hook is always registered, even though the close logic runs conditionally.
> This can be changed so that the close hook is registered conditionally.
> This will help avoid memory leaks in scenarios where a custom component reloads the SolrSuggester multiple times for the same core. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org