prashantwason commented on code in PR #18904:
URL: https://github.com/apache/hudi/pull/18904#discussion_r3354271203
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/heartbeat/HoodieHeartbeatClient.java:
##########
@@ -229,5 +292,11 @@ public Heartbeat getHeartbeat(String instantTime) {
public void close() {
this.stopHeartbeatTimers();
this.instantToHeartbeatMap.clear();
+ synchronized (this) {
Review Comment:
Correction to my note above: CI caught that the heartbeat client is
legitimately **reused after close()** (startCommit /
acquireRollbackHeartbeatIfMultiWriter call start() again on a closed instance),
so a sticky `closed` flag broke that and failed TestJavaHoodieBackedMetadata /
TestHoodieJavaClientOnCopyOnWriteStorage. I removed the flag. `close()` is now
idempotent via `synchronized` + the executor null-check (repeated/concurrent
close is a no-op), while reuse-after-close still works (the executor is lazily
re-created on the next heartbeat). Fixed in 165a2fc.
--
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]