wombatu-kun commented on code in PR #19334:
URL: https://github.com/apache/hudi/pull/19334#discussion_r3629270699


##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/transaction/lock/Heartbeat.java:
##########
@@ -37,7 +37,11 @@ public void run() {
     try {
       client.heartbeat(0, lockId);
     } catch (Exception e) {
-      throw new HoodieLockException(String.format("Failed to heartbeat for 
lock: %d", lockId));
+      // Do not rethrow. This task is scheduled via 
ScheduledExecutorService.scheduleAtFixedRate,
+      // where a thrown exception permanently cancels all subsequent 
executions and is only
+      // observable through the (unread) ScheduledFuture. Swallowing a 
transient failure here keeps
+      // the lock heartbeated on the next tick instead of silently stopping 
renewal altogether.
+      log.warn("Failed to heartbeat for lock: {}", lockId, e);

Review Comment:
   Beyond the log level, the terminal cases should cancel the schedule and 
clear `lock`, so the writer stops assuming it still holds exclusivity. Filed as 
part of #19345.
   



-- 
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