anuragp010 opened a new pull request, #11376:
URL: https://github.com/apache/ozone/pull/11376

   ## What changes were proposed in this pull request?
   `OmSnapshot` overrode `Object.finalize()` to warn if its `DBStore` wasn't 
closed before GC. But `finalize()` is deprecated for removal ([JEP 
421](https://openjdk.org/jeps/421)). This PR replaces it with `LeakDetector`, a 
`ReferenceQueue`-based leak tracker, used in the same way by 
`ManagedRocksObjectUtils`. A static `LEAK_DETECTOR` tracks each `OmSnapshot` 
instance via `LEAK_DETECTOR.track(this, reporter)`. If the instance is dropped 
unclosed, the detector's background thread reports the same warning the old 
`finalize()` did, once the object is actually collected. 
   
   ## What is the link to the Apache JIRA
   [HDDS-16654](https://issues.apache.org/jira/browse/HDDS-16654)
   
   
   ## How was this patch tested?
   1. Newly added Unit Tests
   


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