SOLR-12801: Try to harden closing of zk db in TestConfigSetsAPIZkFailure.

This commit is contained in:
markrmiller 2018-12-09 23:03:11 -06:00
parent 1305501dbd
commit 56b959141f
1 changed files with 8 additions and 0 deletions

View File

@ -104,6 +104,8 @@ public class ZkTestServer {
protected volatile SolrZkClient rootClient; protected volatile SolrZkClient rootClient;
protected volatile SolrZkClient chRootClient; protected volatile SolrZkClient chRootClient;
private volatile ZKDatabase zkDb;
static public enum LimitViolationAction { static public enum LimitViolationAction {
IGNORE, IGNORE,
REPORT, REPORT,
@ -514,6 +516,7 @@ public class ZkTestServer {
} }
public void setZKDatabase(ZKDatabase zkDb) { public void setZKDatabase(ZKDatabase zkDb) {
this.zkDb = zkDb;
zkServer.zooKeeperServer.setZKDatabase(zkDb); zkServer.zooKeeperServer.setZKDatabase(zkDb);
} }
@ -611,6 +614,11 @@ public class ZkTestServer {
} catch (Exception e) { } catch (Exception e) {
log.error("Exception shutting down ZooKeeper Test Server",e); log.error("Exception shutting down ZooKeeper Test Server",e);
} }
if (zkDb != null) {
zkDb.close();
}
while (true) { while (true) {
try { try {
zooThread.join(); zooThread.join();