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


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedObject.java:
##########
@@ -42,7 +49,23 @@ public void close() {
 
   @Override
   protected void finalize() throws Throwable {
-    ManagedRocksObjectUtils.assertClosed(original);
+    ManagedRocksObjectUtils.assertClosed(this);
     super.finalize();
   }
+
+  public String getStackTrace() {
+    if (elements != null && elements.length > 0) {
+      // 15 lines should be good enough to know the caller of
+      // the unclosed instance?
+      int maxStackTraceLines = 15;

Review Comment:
   Ok , I added this as the stackTrace caught in this example was approximately 
50 lines and was occupying the entire screen and if there are multiple such 
instances it can flood the debug log with these but I guess we should be okay 
if there are not many such instances.



##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedObject.java:
##########
@@ -42,7 +49,23 @@ public void close() {
 
   @Override
   protected void finalize() throws Throwable {
-    ManagedRocksObjectUtils.assertClosed(original);
+    ManagedRocksObjectUtils.assertClosed(this);
     super.finalize();
   }
+
+  public String getStackTrace() {

Review Comment:
   Done.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to