This is an automated email from the ASF dual-hosted git repository.

danny0405 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new d1dfa5b6be3 [HUDI-7148] Add an additional fix to the potential thread 
insecurity problem of heartbeat client (#10188)
d1dfa5b6be3 is described below

commit d1dfa5b6be3adbe18920dc2819455dbca8b29898
Author: Dongsj <[email protected]>
AuthorDate: Wed Nov 29 10:49:38 2023 +0800

    [HUDI-7148] Add an additional fix to the potential thread insecurity 
problem of heartbeat client (#10188)
    
    Co-authored-by: dongsj <[email protected]>
---
 .../java/org/apache/hudi/client/heartbeat/HoodieHeartbeatClient.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/heartbeat/HoodieHeartbeatClient.java
 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/heartbeat/HoodieHeartbeatClient.java
index 76bdbc46174..d141094e4ad 100644
--- 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/heartbeat/HoodieHeartbeatClient.java
+++ 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/heartbeat/HoodieHeartbeatClient.java
@@ -266,6 +266,11 @@ public class HoodieHeartbeatClient implements 
AutoCloseable, Serializable {
       heartbeat.setLastHeartbeatTime(newHeartbeatTime);
       heartbeat.setNumHeartbeats(heartbeat.getNumHeartbeats() + 1);
     } catch (IOException io) {
+      Boolean isHeartbeatStopped = 
instantToHeartbeatMap.get(instantTime).isHeartbeatStopped;
+      if (isHeartbeatStopped) {
+        LOG.warn(String.format("update heart beat failed, because the instant 
time %s was stopped ? : %s", instantTime, isHeartbeatStopped));
+        return;
+      }
       throw new HoodieHeartbeatException("Unable to generate heartbeat for 
instant " + instantTime, io);
     }
   }

Reply via email to