代码拉取完成,页面将自动刷新
From 55a5e7592bb39170004b7dddd4083ed5c66d8e80 Mon Sep 17 00:00:00 2001
From: "jianghang.loujh" <[email protected]>
Date: Fri, 3 Nov 2023 11:04:11 +0800
Subject: [PATCH] fixed issue #4930 , check embeddedServerstate
---
.../otter/canal/deployer/CanalController.java | 43 ++++++++++---------
.../deployer/admin/CanalAdminController.java | 2 +-
2 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java b/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java
index 11a915471c..e534763372 100644
--- a/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java
+++ b/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java
@@ -1,5 +1,26 @@
package com.alibaba.otter.canal.deployer;
+import static com.alibaba.otter.canal.deployer.CanalConstants.CANAL_DESTINATIONS;
+import static com.alibaba.otter.canal.deployer.CanalConstants.CANAL_DESTINATIONS_EXPR;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import org.I0Itec.zkclient.IZkStateListener;
+import org.I0Itec.zkclient.exception.ZkNoNodeException;
+import org.I0Itec.zkclient.exception.ZkNodeExistsException;
+import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.zookeeper.Watcher.Event.KeeperState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+
import com.alibaba.otter.canal.common.utils.AddressUtils;
import com.alibaba.otter.canal.common.zookeeper.ZkClientx;
import com.alibaba.otter.canal.common.zookeeper.ZookeeperPathUtils;
@@ -23,26 +44,6 @@
import com.google.common.base.Function;
import com.google.common.collect.MapMaker;
import com.google.common.collect.MigrateMap;
-import org.I0Itec.zkclient.IZkStateListener;
-import org.I0Itec.zkclient.exception.ZkNoNodeException;
-import org.I0Itec.zkclient.exception.ZkNodeExistsException;
-import org.apache.commons.lang.BooleanUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.zookeeper.Watcher.Event.KeeperState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-import static com.alibaba.otter.canal.deployer.CanalConstants.CANAL_DESTINATIONS;
-import static com.alibaba.otter.canal.deployer.CanalConstants.CANAL_DESTINATIONS_EXPR;
/**
* canal调度控制器
@@ -601,7 +602,7 @@ public void stop() throws Throwable {
ZkClientx.clearClients();
// 需要释放 CanalServerWithEmbedded 否则主线程退出后,进程无法自动完整退出...
- if (embeddedCanalServer != null) {
+ if (embeddedCanalServer != null && embeddedCanalServer.isStart()) {
embeddedCanalServer.stop();
}
}
diff --git a/deployer/src/main/java/com/alibaba/otter/canal/deployer/admin/CanalAdminController.java b/deployer/src/main/java/com/alibaba/otter/canal/deployer/admin/CanalAdminController.java
index b50809e05e..a842a00718 100644
--- a/deployer/src/main/java/com/alibaba/otter/canal/deployer/admin/CanalAdminController.java
+++ b/deployer/src/main/java/com/alibaba/otter/canal/deployer/admin/CanalAdminController.java
@@ -37,7 +37,7 @@ public class CanalAdminController implements CanalAdmin {
private static final Logger logger = LoggerFactory.getLogger(CanalAdminController.class);
private String user;
private String passwd;
- private CanalStarter canalStater;
+ private CanalStarter canalStater;
public CanalAdminController(CanalStarter canalStater){
this.canalStater = canalStater;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。