You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/07/23 06:11:20 UTC
[dolphinscheduler] branch 1.3.7-prepare updated:
[Improvement][Server] Must restart master if Zk reconnect (#5210) (#5879)
This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch 1.3.7-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/1.3.7-prepare by this push:
new 9553943 [Improvement][Server] Must restart master if Zk reconnect (#5210) (#5879)
9553943 is described below
commit 95539436d1f046be00148b286695f4b8eb954417
Author: Wenjun Ruan <86...@qq.com>
AuthorDate: Fri Jul 23 14:11:08 2021 +0800
[Improvement][Server] Must restart master if Zk reconnect (#5210) (#5879)
issue #5210
pr #5211
---
.../apache/dolphinscheduler/service/zk/ZookeeperOperator.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZookeeperOperator.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZookeeperOperator.java
index b635dc7..dbfb8e2 100644
--- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/ZookeeperOperator.java
+++ b/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));
}
- 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);
}