adoroszlai commented on code in PR #3827: URL: https://github.com/apache/ozone/pull/3827#discussion_r993756288
########## 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: Would be nice to avoid duplicating logic from `assertClosed(RocksObject, Throwable)`. -- 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-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org