Re: [PR] [HUDI-6940] OutputStream maybe not close with try block in HoodieHeartbeatClient [hudi]
ksmou closed pull request #9855: [HUDI-6940] OutputStream maybe not close with try block in HoodieHeartbeatClient URL: https://github.com/apache/hudi/pull/9855 -- 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
Re: [PR] [HUDI-6940] OutputStream maybe not close with try block in HoodieHeartbeatClient [hudi]
ksmou commented on code in PR #9855: URL: https://github.com/apache/hudi/pull/9855#discussion_r1360015052 ## 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: ok, I understant. No need to do this. -- 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
Re: [PR] [HUDI-6940] OutputStream maybe not close with try block in HoodieHeartbeatClient [hudi]
danny0405 commented on code in PR #9855: URL: https://github.com/apache/hudi/pull/9855#discussion_r1359025464 ## 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: If we want to flush something or see the heartbeats immediately, we need to close the outputstream before we do the heartbeat check. Do you think it is necessary? -- 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
Re: [PR] [HUDI-6940] OutputStream maybe not close with try block in HoodieHeartbeatClient [hudi]
hudi-bot commented on PR #9855: URL: https://github.com/apache/hudi/pull/9855#issuecomment-1761120970 ## CI report: * 1ea7baca7d8632d1848e5653881a4a3cd7d715e7 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20321) Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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
Re: [PR] [HUDI-6940] OutputStream maybe not close with try block in HoodieHeartbeatClient [hudi]
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
Re: [PR] [HUDI-6940] OutputStream maybe not close with try block in HoodieHeartbeatClient [hudi]
danny0405 commented on code in PR #9855: URL: https://github.com/apache/hudi/pull/9855#discussion_r1357767211 ## 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: It has been closed in this line? -- 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
Re: [PR] [HUDI-6940] OutputStream maybe not close with try block in HoodieHeartbeatClient [hudi]
hudi-bot commented on PR #9855: URL: https://github.com/apache/hudi/pull/9855#issuecomment-1760714040 ## CI report: * 1ea7baca7d8632d1848e5653881a4a3cd7d715e7 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20321) Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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
Re: [PR] [HUDI-6940] OutputStream maybe not close with try block in HoodieHeartbeatClient [hudi]
hudi-bot commented on PR #9855: URL: https://github.com/apache/hudi/pull/9855#issuecomment-1760709149 ## CI report: * 1ea7baca7d8632d1848e5653881a4a3cd7d715e7 UNKNOWN Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build -- 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