You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Duong (Jira)" <ji...@apache.org> on 2023/12/23 06:58:00 UTC

[jira] [Commented] (HDDS-10000) Improve LeakDetector

    [ 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: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org