fixed issue #296, support getWithoutAck/ack/rollback for NPE

This commit is contained in:
七锋
2018-07-16 23:00:35 +08:00
parent c1805a4831
commit bef6a66eaf
@@ -184,7 +184,7 @@ public class ClusterCanalConnector implements CanalConnector {
return msg;
} catch (Throwable t) {
logger.warn(String.format("something goes wrong when getWithoutAck data from server:%s",
currentConnector.getAddress()), t);
currentConnector != null ? currentConnector.getAddress() : "null"), t);
times++;
restart();
logger.info("restart the connector for next round retry.");
@@ -201,7 +201,7 @@ public class ClusterCanalConnector implements CanalConnector {
return msg;
} catch (Throwable t) {
logger.warn(String.format("something goes wrong when getWithoutAck data from server:%s",
currentConnector.getAddress()), t);
currentConnector != null ? currentConnector.getAddress() : "null"), t);
times++;
restart();
logger.info("restart the connector for next round retry.");
@@ -218,7 +218,7 @@ public class ClusterCanalConnector implements CanalConnector {
return;
} catch (Throwable t) {
logger.warn(String.format("something goes wrong when rollbacking data from server:%s",
currentConnector.getAddress()),
currentConnector != null ? currentConnector.getAddress() : "null"),
t);
times++;
restart();
@@ -236,7 +236,7 @@ public class ClusterCanalConnector implements CanalConnector {
return;
} catch (Throwable t) {
logger.warn(String.format("something goes wrong when rollbacking data from server:%s",
currentConnector.getAddress()),
currentConnector != null ? currentConnector.getAddress() : "null"),
t);
times++;
restart();
@@ -255,7 +255,7 @@ public class ClusterCanalConnector implements CanalConnector {
return;
} catch (Throwable t) {
logger.warn(String.format("something goes wrong when acking data from server:%s",
currentConnector.getAddress()),
currentConnector != null ? currentConnector.getAddress() : "null"),
t);
times++;
restart();