Projects
Eulaceura:Mainline
canal
_service:obs_scm:backport-fixed-issue-#4930-che...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:backport-fixed-issue-#4930-check-embeddedServerstate.patch of Package canal
From 55a5e7592bb39170004b7dddd4083ed5c66d8e80 Mon Sep 17 00:00:00 2001 From: "jianghang.loujh" <jianghang.loujh@alibaba-inc.com> 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;
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2