SOLR-9392: Fixed CDCR Test failures which were due to leaked resources

This commit is contained in:
Shalin Shekhar Mangar 2016-08-08 07:25:10 +05:30
parent 678d3f007a
commit bfee2292a3
2 changed files with 11 additions and 0 deletions

View File

@ -236,6 +236,8 @@ Other Changes
* SOLR-9353: Factor out ReRankQParserPlugin.ReRankQueryRescorer private class. (Christine Poerschke)
* SOLR-9392: Fixed CDCR Test failures which were due to leaked resources. (shalin)
================== 6.1.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

View File

@ -49,6 +49,7 @@ import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.params.CollectionParams;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.IOUtils;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.StrUtils;
import org.apache.solr.common.util.Utils;
@ -667,6 +668,14 @@ public class BaseCdcrDistributedZkTest extends AbstractDistribZkTestBase {
}
}
List<CloudJettyRunner> oldRunners = this.cloudJettys.putIfAbsent(collection, cloudJettys);
if (oldRunners != null) {
// must close resources for the old entries
for (CloudJettyRunner oldRunner : oldRunners) {
IOUtils.closeQuietly(oldRunner.client);
}
}
this.cloudJettys.put(collection, cloudJettys);
this.shardToJetty.put(collection, shardToJetty);
this.shardToLeaderJetty.put(collection, shardToLeaderJetty);