lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] [Updated] (SOLR-3699) fix CoreContainerCoreInitFailuresTest directory leak
Date Thu, 02 Aug 2012 16:36:02 GMT


Hoss Man updated SOLR-3699:

    Attachment: SOLR-3699.patch

Tracked the problem down to SolrIndexWriter ... attached patch demonstrates it in the simplest
usecase: a SolrCore that constructs a SolrIndexWriter where the Directory is created fine,
but then the IndexWriterConfig has a problem.

Unfortunately there's no clear and easy route to a fix because of how this is all done inline
in a call to {{super(...)}} ... as noted in the test comments...

  public void testBogusMergePolicy() throws Exception {
    // Directory is leaked because SolrIndexWriter constructor has inline 
    // calls to both DirectoryFactory (which succeeds) and 
    // Config.toIndexWriterConfig (which fails) -- but there is nothing to 
    // decref the DerectoryFactory when Config throws an Exception
    // Not good to require the caller of "new SolrIndexWriter(...)" to decref 
    // the DirectoryFactory on exception, because they would have to be sure 
    // the exception didn't already come from the DirectoryFactory in the first place.
    // I think we need to re-work the inline calls in SolrIndexWriter construct

(Ironically: this "bad-mp-config.xml" i was using in CoreContainerCoreInitFailuresTest has
existed for a while, but wasn't already being used in the "TestBadConfig" class that tries
to create SolrCores with bad cofigs -- if it had we would have caught this a long time ago.
 It was only being used in SolrIndexConfigTest where it was micro testing the SolrIndexConfig
and the DirectoryFactory wasn't used)

> fix CoreContainerCoreInitFailuresTest directory leak
> ----------------------------------------------------
>                 Key: SOLR-3699
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Robert Muir
>             Fix For: 4.0, 5.0
>         Attachments: 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:!default.jspa
For more information on JIRA, see:


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

View raw message