Skip to content

Commit

Permalink
[HUDI-7148] Add an additional fix to the potential thread insecurity …
Browse files Browse the repository at this point in the history
…problem of heartbeat client (apache#10188)

Co-authored-by: dongsj <dongsj@asiainfo.com>
  • Loading branch information
eric9204 and dongsj authored Nov 29, 2023
1 parent 77cfb3a commit d1dfa5b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ private void updateHeartbeat(String instantTime) throws HoodieHeartbeatException
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);
}
}
Expand Down

0 comments on commit d1dfa5b

Please sign in to comment.