[
https://issues.apache.org/jira/browse/HDDS-13293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tsz-wo Sze updated HDDS-13293:
------------------------------
Issue Type: Bug (was: Improvement)
> In KeyManagerImpl.listStatus(..), iterator may leak
> ---------------------------------------------------
>
> Key: HDDS-13293
> URL: https://issues.apache.org/jira/browse/HDDS-13293
> Project: Apache Ozone
> Issue Type: Bug
> Components: OM
> Reporter: Tsz-wo Sze
> Assignee: Tsz-wo Sze
> Priority: Major
>
> {code}
> TableIterator<String, ? extends KeyValue<String, OmKeyInfo>> iterator;
> Table<String, OmKeyInfo> keyTable;
> metadataManager.getLock().acquireReadLock(BUCKET_LOCK, volumeName,
> bucketName);
> try {
> keyTable = metadataManager.getKeyTable(
> getBucketLayout(metadataManager, volumeName, bucketName));
> iterator = getIteratorForKeyInTableCache(recursive, startKey,
> volumeName, bucketName, cacheKeyMap, keyArgs, keyTable);
> } finally {
> metadataManager.getLock().releaseReadLock(BUCKET_LOCK, volumeName,
> bucketName);
> }
> try {
> findKeyInDbWithIterator(recursive, startKey, numEntries, volumeName,
> bucketName, keyName, cacheKeyMap, keyArgs, keyTable, iterator);
> } finally {
> iterator.close();
> }
> {code}
> In the code above, if the first try-block throws an exception, the
> iterator.close() in the second finally-block will not be called.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]