Browse Source

[Improvement][Server] Must restart master if Zk reconnect (#5210) (#5879)

issue #5210
  pr #5211
Wenjun Ruan 3 years ago committed by GitHub
parent
commit
95539436d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZookeeperOperator.java

9
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZookeeperOperator.java

@ -185,13 +185,10 @@ public class ZookeeperOperator implements InitializingBean {
public void persistEphemeral(final String key, final String value) {
try {
if (isExisted(key)) {
try {
zkClient.delete().deletingChildrenIfNeeded().forPath(key);
} catch (NoNodeException ignore) {
//NOP
}
}
update(key, value);
} else {
zkClient.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPath(key, value.getBytes(StandardCharsets.UTF_8));
}
} catch (final Exception ex) {
logger.error("persistEphemeral key : {} , value : {}", key, value, ex);
}

Loading…
Cancel
Save