adoroszlai opened a new pull request, #6013:
URL: https://github.com/apache/ozone/pull/6013
## What changes were proposed in this pull request?
`RocksDatabase.newIterator(ColumnFamily, boolean)` returns an iterator whose
`readOptions` is closed right after creating the iterator. This seems wrong,
since closing it invalidates the native handle. I'm not sure how this can
result in leakage of the `readOptions` object as reported by the leak detector:
```
[LeakDetector-ManagedRocksObject0] WARN managed.ManagedRocksObjectUtils
(ManagedRocksObjectUtils.java:reportLeak(62)) - ManagedReadOptions is not
closed properly
StackTrace for unclosed instance:
org.apache.hadoop.hdds.utils.db.managed.ManagedReadOptions.<init>(ManagedReadOptions.java:30)
org.apache.hadoop.hdds.utils.db.RocksDatabase.newIterator(RocksDatabase.java:778)
org.apache.hadoop.hdds.utils.db.RDBTable.iterator(RDBTable.java:232)
org.apache.hadoop.hdds.utils.db.TypedTable.iterator(TypedTable.java:419)
org.apache.hadoop.hdds.utils.db.TypedTable.iterator(TypedTable.java:410)
org.apache.hadoop.hdds.utils.db.TypedTable.iterator(TypedTable.java:55)
org.apache.hadoop.ozone.om.service.DirectoryDeletingService$DirDeletingTask.call(DirectoryDeletingService.java:169)
org.apache.hadoop.hdds.utils.BackgroundService$PeriodicalTask.lambda$run$0(BackgroundService.java:140)
```
from:
```
org.apache.hadoop.fs.ozone.TestRootedDDSWithFSO -- Time elapsed: 23.00 s <<<
FAILURE!
java.lang.AssertionError: Found 1 leaked objects, check logs
at
org.apache.hadoop.hdds.utils.db.managed.ManagedRocksObjectMetrics.assertNoLeaks(ManagedRocksObjectMetrics.java:61)
at
org.apache.hadoop.ozone.MiniOzoneClusterImpl.shutdown(MiniOzoneClusterImpl.java:457)
at
org.apache.hadoop.fs.ozone.TestRootedDDSWithFSO.teardown(TestRootedDDSWithFSO.java:123)
```
This patch proposes to keep track of the `ReadOptions` (and possibly other
objects, e.g. lower/upper boundary `Slice`) with the `ManagedIterator`, and
close them at the same time when the iterator is closed.
https://issues.apache.org/jira/browse/HDDS-10134
## How was this patch tested?
`TestRootedDDSWithFSO` passed in 10x10 runs (but it also passed with
`master`, so more repetitions may be needed).
Regular CI:
https://github.com/adoroszlai/ozone/actions/runs/7539928782
--
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]