فهرست منبع

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

七锋 7 سال پیش
والد
کامیت
bef6a66eaf
1فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 5 5
      client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java

+ 5 - 5
client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java

@@ -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();