[
https://issues.apache.org/jira/browse/HDDS-10000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17800002#comment-17800002
]
Duong commented on HDDS-10000:
------------------------------
Some thoughts on making LeakTracker an AutoClosable and using the interface to
pass around.
1. It's not a closable resource. The only method could be 'notifyClose()'
instead of 'close'. The client code holding a `AutoClosable` would be less
readable, because it's not as obvious to express that it's just a tracker. At
the first sign I'd understand it's another sub-resource to close/relase.
2. No, it's not "auto" closable. We'd never use it in a try-with-resource
statement.
The remaining points look good.
> Improve LeakDetector
> --------------------
>
> Key: HDDS-10000
> URL: https://issues.apache.org/jira/browse/HDDS-10000
> Project: Apache Ozone
> Issue Type: Improvement
> Affects Versions: 1.5.0
> Reporter: Attila Doroszlai
> Assignee: Attila Doroszlai
> Priority: Major
>
> HDDS-9528 introduces a leak detector framework.
> Possible improvements:
> * simplify managed objects by moving {{getStackTrace()}} into {{track()}}
> (need to skip +1 level in {{formatStackTrace()}}
> * let {{LeakTracker}} implement {{AutoCloseable}} and change methods that
> return it to use the interface
> * distinguish detectors with the same name by appending a unique integer
> * split two test cases in {{TestLeakDetector}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]