You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/03/17 14:43:11 UTC

[GitHub] [hudi] nsivabalan commented on a change in pull request #5042: Three bulk_insert files are concurrently submitted and executed with a difference of 2s, the insert fails occasionally.

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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org