nsivabalan commented on a change in pull request #5042:
URL: https://github.com/apache/hudi/pull/5042#discussion_r829170253



##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/heartbeat/HoodieHeartbeatClient.java
##########
@@ -233,7 +233,7 @@ public boolean isHeartbeatExpired(String instantTime) 
throws IOException {
       lastHeartbeatForWriter.setLastHeartbeatTime(lastHeartbeatForWriterTime);
       lastHeartbeatForWriter.setInstantTime(instantTime);
     }
-    if (currentTime - lastHeartbeatForWriter.getLastHeartbeatTime() > 
this.maxAllowableHeartbeatIntervalInMs) {
+    if (currentTime - lastHeartbeatForWriter.getLastHeartbeatTime() > 
this.maxAllowableHeartbeatIntervalInMs && 
lastHeartbeatForWriter.getLastHeartbeatTime() > 0L) {

Review comment:
       if I understand correctly, isHeartBeatExpired(instantTime) is not thread 
safe. If two concurrent writers, tries to execute this, we could run into 
problems. 
   also, Can you help me understand how the fix you have put in would help 
here. looks like we are setting the lastHeartBeatTime in L233 right. so, not 
sure what this fix is helping us with. 




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