danny0405 commented on code in PR #9135:
URL: https://github.com/apache/hudi/pull/9135#discussion_r1254414573


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/heartbeat/HoodieHeartbeatClient.java:
##########
@@ -228,7 +228,10 @@ public boolean isHeartbeatExpired(String instantTime) 
throws IOException {
       lastHeartbeatForWriter.setInstantTime(instantTime);
       lastHeartbeatForWriter.getTimer().cancel();
     }
-    if (currentTime - lastHeartbeatForWriter.getLastHeartbeatTime() > 
this.maxAllowableHeartbeatIntervalInMs) {
+    // When the last write had failed, the heartbeat client would close with 
stopping all heartbeat which
+    // includes deleting heartbeat file. Therefore, it isn't heartbeat expired 
for the last failed write.
+    if (lastHeartbeatForWriter.getLastHeartbeatTime() != 0L
+        && currentTime - lastHeartbeatForWriter.getLastHeartbeatTime() > 
this.maxAllowableHeartbeatIntervalInMs) {
       LOG.warn("Heartbeat expired, currentTime = " + currentTime + ", last 
heartbeat = " + lastHeartbeatForWriter

Review Comment:
   There maybe some use cases that some stray tasks are still there and we want 
to commit the instant, but in general, fix it would avoid some error reportings 
like the instant recommit.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to