You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/08/15 15:40:30 UTC

[GitHub] [ozone] duongnguyen0 commented on a diff in pull request #3678: HDDS-6726. Close RocksObject in Recon and tools

duongnguyen0 commented on code in PR #3678:
URL: https://github.com/apache/ozone/pull/3678#discussion_r945885298


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHADBTransactionBufferImpl.java:
##########
@@ -138,5 +138,8 @@ public String toString() {
 
   @Override
   public void close() throws IOException {
+    if (currentBatchOperation != null) {
+      currentBatchOperation.close();

Review Comment:
   `currentBatchOperation` can be closed multiple times without side effects and only the first invoke makes an impact. Internally, every RocksObject maintains an atomic internal state to tell if it's closed.
   
   If we put a side-effect to change the `SCMHADBTransactionBufferImpl` state in `close`, we may need to make it `synchronized`. 



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org