YARN-9714. ZooKeeper connection in ZKRMStateStore leaks after RM transitioned to standby. Contributed by Tao Yang.
This commit is contained in:
parent
d59fc59c9f
commit
5b557de721
@ -453,7 +453,7 @@ protected synchronized void closeInternal() throws Exception {
|
||||
verifyActiveStatusThread.join(1000);
|
||||
}
|
||||
|
||||
if (!HAUtil.isHAEnabled(getConfig())) {
|
||||
if (resourceManager.getZKManager() == null) {
|
||||
CuratorFramework curatorFramework = zkManager.getCurator();
|
||||
IOUtils.closeStream(curatorFramework);
|
||||
}
|
||||
|
@ -453,6 +453,7 @@ public void testZKRootPathAcls() throws Exception {
|
||||
rm = new MockRM(conf);
|
||||
rm.start();
|
||||
rm.getRMContext().getRMAdminService().transitionToActive(req);
|
||||
stateStore = (ZKRMStateStore) rm.getRMContext().getStateStore();
|
||||
acls = stateStore.getACL(rootPath);
|
||||
assertEquals(acls.size(), 1);
|
||||
verifyZKACL("world", "anyone", Perms.ALL, acls);
|
||||
@ -463,6 +464,7 @@ public void testZKRootPathAcls() throws Exception {
|
||||
rm = new MockRM(conf);
|
||||
rm.start();
|
||||
rm.getRMContext().getRMAdminService().transitionToActive(req);
|
||||
stateStore = (ZKRMStateStore) rm.getRMContext().getStateStore();
|
||||
acls = stateStore.getACL(rootPath);
|
||||
assertThat(acls).hasSize(2);
|
||||
verifyZKACL("digest", "localhost", Perms.CREATE | Perms.DELETE, acls);
|
||||
|
Loading…
Reference in New Issue
Block a user