lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller (JIRA)" <>
Subject [jira] [Commented] (SOLR-3699) SolrIndexWriter constructor leaks Directory if Exception creating IndexWriterConfig
Date Thu, 30 Aug 2012 13:50:08 GMT


Mark Miller commented on SOLR-3699:

hmm...I have to look closer than just at the patch, but the setDirFactory method seems a little
troubling - why do we do that instead of making it part of the constructor? What if you don't
set it?

+        if (null != directoryFactory) {
+          // :HACK: normally we rely on updateHandler to do this, 
+          // but what if updateHandler failed to init?
+          directoryFactory.close();
+        }

I don't think you want that? The dir factory should and will be closed by the DefaultSolrCoreState
when it's ref count hits 0 - you don't actually want to close it when closing a core.

Otherwise, the basic idea seems fine - if the IW fails, release it's dir.
> SolrIndexWriter constructor leaks Directory if Exception creating IndexWriterConfig
> -----------------------------------------------------------------------------------
>                 Key: SOLR-3699
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Assignee: Mark Miller
>             Fix For: 4.0
>         Attachments: SOLR-3699.patch, SOLR-3699.patch, SOLR-3699.patch, SOLR-3699.patch
> in LUCENE-4278 i had to add a hack to force SimpleFSDir for CoreContainerCoreInitFailuresTest,
because it doesnt close its Directory on certain errors.
> This might indicate a problem that leaks happen if certain errors happen (e.g. not handled
in finally)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message