mirror of https://github.com/apache/lucene.git
SOLR-12801: Try to harden closing of zk db in TestConfigSetsAPIZkFailure.
This commit is contained in:
parent
1305501dbd
commit
56b959141f
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue