You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/12 02:27:34 UTC

[GitHub] [shardingsphere] azexcy commented on a diff in pull request #21513: Improve processed records count calculatation at pipeline increment task.

azexcy commented on code in PR #21513:
URL: https://github.com/apache/shardingsphere/pull/21513#discussion_r992923456


##########
kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/MySQLClient.java:
##########
@@ -298,14 +298,18 @@ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cau
             log.error("MySQLBinlogEventHandler protocol resolution error, file name:{}, position:{}", fileName, position, cause);
             reconnect();
         }
-        
+    
         private void reconnect() {
             if (reconnectTimes.get() > 3) {
                 log.warn("exceeds the maximum number of retry times, last binlog event:{}", lastBinlogEvent);
                 running = false;
                 return;
             }
             int retryTimes = reconnectTimes.incrementAndGet();
+            if (null == lastBinlogEvent.getFileName()) {
+                log.warn("can't get file name from binlog event, last binlog event:{}", lastBinlogEvent);
+                return;
+            }

Review Comment:
   somethimes ,the lastBinlogEvent isn's set value after `connect()`, then if execute stop migration the `reconnect()` method will execute, will cause NPE at `subscribe(lastBinlogEvent.getFileName(), lastBinlogEvent.getPosition());`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org