voonhous commented on code in PR #19334:
URL: https://github.com/apache/hudi/pull/19334#discussion_r3629096538
##########
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:
Swallowing is right for transient errors, but a *permanent* one (e.g.
`NoSuchLockException` after HMS already expired the lock) now just warns every
tick while the writer still thinks it holds the lock. Strictly better than the
old silent stop -- but worth a follow-up to escalate to `log.error` (or
invalidate the lock) on lock-gone exception types.
--
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]