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/10/13 07:01:25 UTC

[GitHub] [ozone] sadanand48 commented on a diff in pull request #3827: HDDS-7316. Print stacktrace to identify the location of RocksObject leaks.

sadanand48 commented on code in PR #3827:
URL: https://github.com/apache/ozone/pull/3827#discussion_r994234354


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedRocksObjectUtils.java:
##########
@@ -41,6 +41,20 @@ static void assertClosed(RocksObject rocksObject) {
     }
   }
 
+  static void assertClosed(ManagedObject<?> object) {
+    RocksObject rocksObject = object.get();
+    ManagedRocksObjectMetrics.INSTANCE.increaseManagedObject();
+    if (rocksObject.isOwningHandle()) {
+      ManagedRocksObjectMetrics.INSTANCE.increaseLeakObject();
+      LOG.warn("{} is not closed properly",
+          rocksObject.getClass().getSimpleName());
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("StackTrace for unclosed instance: {}",
+            object.getStackTrace());
+      }
+    }

Review Comment:
   Done. There were no callers for `assertClosed(RocksObject, Throwable)`, removed it, maybe we can add later if it's of use. 



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