ksmou commented on code in PR #9855: URL: https://github.com/apache/hudi/pull/9855#discussion_r1357864818
########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/heartbeat/HoodieHeartbeatClient.java: ########## @@ -250,11 +250,8 @@ public boolean isHeartbeatExpired(String instantTime) throws IOException { } private void updateHeartbeat(String instantTime) throws HoodieHeartbeatException { - try { + try (OutputStream outputStream = this.fs.create(new Path(heartbeatFolderPath + Path.SEPARATOR + instantTime), true)) { Long newHeartbeatTime = System.currentTimeMillis(); - OutputStream outputStream = - this.fs.create(new Path(heartbeatFolderPath + Path.SEPARATOR + instantTime), true); - outputStream.close(); Review Comment: OutputStream may not close gracefully. I found it is similar to https://github.com/apache/hudi/pull/9309 -- 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-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org