mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fixed lazy
This commit is contained in:
@@ -192,10 +192,10 @@ public class CanalController {
|
|||||||
instanceConfigs.put(destination, config);
|
instanceConfigs.put(destination, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.getLazy() && !embededCanalServer.isStart(destination)) {
|
if (!embededCanalServer.isStart(destination)) {
|
||||||
// HA机制启动
|
// HA机制启动
|
||||||
ServerRunningMonitor runningMonitor = ServerRunningMonitors.getRunningMonitor(destination);
|
ServerRunningMonitor runningMonitor = ServerRunningMonitors.getRunningMonitor(destination);
|
||||||
if (!runningMonitor.isStart()) {
|
if (!config.getLazy() && !runningMonitor.isStart()) {
|
||||||
runningMonitor.start();
|
runningMonitor.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -392,10 +392,10 @@ public class CanalController {
|
|||||||
final String destination = entry.getKey();
|
final String destination = entry.getKey();
|
||||||
InstanceConfig config = entry.getValue();
|
InstanceConfig config = entry.getValue();
|
||||||
// 创建destination的工作节点
|
// 创建destination的工作节点
|
||||||
if (!config.getLazy() && !embededCanalServer.isStart(destination)) {
|
if (!embededCanalServer.isStart(destination)) {
|
||||||
// HA机制启动
|
// HA机制启动
|
||||||
ServerRunningMonitor runningMonitor = ServerRunningMonitors.getRunningMonitor(destination);
|
ServerRunningMonitor runningMonitor = ServerRunningMonitors.getRunningMonitor(destination);
|
||||||
if (!runningMonitor.isStart()) {
|
if (!config.getLazy() && !runningMonitor.isStart()) {
|
||||||
runningMonitor.start();
|
runningMonitor.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class SessionHandler extends SimpleChannelHandler {
|
|||||||
Short.valueOf(sub.getClientId()),
|
Short.valueOf(sub.getClientId()),
|
||||||
sub.getFilter());
|
sub.getFilter());
|
||||||
MDC.put("destination", clientIdentity.getDestination());
|
MDC.put("destination", clientIdentity.getDestination());
|
||||||
|
|
||||||
// 尝试启动,如果已经启动,忽略
|
// 尝试启动,如果已经启动,忽略
|
||||||
if (!embeddedServer.isStart(clientIdentity.getDestination())) {
|
if (!embeddedServer.isStart(clientIdentity.getDestination())) {
|
||||||
ServerRunningMonitor runningMonitor = ServerRunningMonitors.getRunningMonitor(clientIdentity.getDestination());
|
ServerRunningMonitor runningMonitor = ServerRunningMonitors.getRunningMonitor(clientIdentity.getDestination());
|
||||||
@@ -74,9 +74,8 @@ public class SessionHandler extends SimpleChannelHandler {
|
|||||||
runningMonitor.start();
|
runningMonitor.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
embeddedServer.subscribe(clientIdentity);
|
|
||||||
|
|
||||||
|
embeddedServer.subscribe(clientIdentity);
|
||||||
ctx.setAttachment(clientIdentity);// 设置状态数据
|
ctx.setAttachment(clientIdentity);// 设置状态数据
|
||||||
NettyUtils.ack(ctx.getChannel(), null);
|
NettyUtils.ack(ctx.getChannel(), null);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user