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/11 20:05:35 UTC

[GitHub] [ozone] duongnguyen0 opened a new pull request, #3678: HDDS-6726. Close RocksObject in Recon and tools

duongnguyen0 opened a new pull request, #3678:
URL: https://github.com/apache/ozone/pull/3678

   ## What changes were proposed in this pull request?
   
   Ensure all remaining usages of RocksObject (in tools, Recon, and everywhere) are closed.
   This is a split from #3646.
   
   https://issues.apache.org/jira/browse/HDDS-6726
   
   ## How was this patch tested?
   
   Standard CI: https://github.com/duongnguyen0/ozone/actions/runs/2842465309


-- 
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


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

Posted by GitBox <gi...@apache.org>.
smengcl commented on code in PR #3678:
URL: https://github.com/apache/ozone/pull/3678#discussion_r945490868


##########
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:
   Can `currentBatchOperation` be safely closed twice without any side effects? If not, does it make sense to set `currentBatchOperation` to `null` here just in case there is a pathological caller where this could be closed twice?
   
   ```suggestion
         currentBatchOperation.close();
         currentBatchOperation = null;
   ```



-- 
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


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

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [ozone] smengcl merged pull request #3678: HDDS-6726. Close RocksObject in Recon and tools

Posted by GitBox <gi...@apache.org>.
smengcl merged PR #3678:
URL: https://github.com/apache/ozone/pull/3678


-- 
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


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

Posted by GitBox <gi...@apache.org>.
smengcl commented on PR #3678:
URL: https://github.com/apache/ozone/pull/3678#issuecomment-1215541235

   Thanks @duongnguyen0 for the patch. Thanks @jojochuang @szetszwo for reviewing.


-- 
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


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

Posted by GitBox <gi...@apache.org>.
duongnguyen0 commented on PR #3678:
URL: https://github.com/apache/ozone/pull/3678#issuecomment-1212442716

   @ChenSammi @jojochuang @smengcl @szetszwo  Can you please take a look?
   


-- 
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


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

Posted by GitBox <gi...@apache.org>.
szetszwo commented on PR #3678:
URL: https://github.com/apache/ozone/pull/3678#issuecomment-1214295945

   @duongnguyen0 , there are some Conflicting files.  Could you update this change?


-- 
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


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

Posted by GitBox <gi...@apache.org>.
duongnguyen0 commented on PR #3678:
URL: https://github.com/apache/ozone/pull/3678#issuecomment-1214393541

   > @duongnguyen0 , there are some Conflicting files. Could you update this change?
   
   Sure, thanks for noticing it. I merged from upstream and also made some updates on top of the new changes.  


-- 
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


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

Posted by GitBox <gi...@apache.org>.
smengcl commented on code in PR #3678:
URL: https://github.com/apache/ozone/pull/3678#discussion_r946000029


##########
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:
   Got it. Thx!



-- 
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


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

Posted by GitBox <gi...@apache.org>.
duongnguyen0 commented on PR #3678:
URL: https://github.com/apache/ozone/pull/3678#issuecomment-1215189444

   > Thanks @duongnguyen0 for the patch. This should help us combat potential RDB iterator mem leaks because of not closing the iterator after use.
   
   Thanks a lot for looking at it @smengcl.


-- 
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