You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "slfan1989 (via GitHub)" <gi...@apache.org> on 2026/03/29 03:04:15 UTC

[I] [Improvement]: Resource leak in CombinedDeleteFilter and MixedDeleteFilter position delete iterators [amoro]

slfan1989 opened a new issue, #4147:
URL: https://github.com/apache/amoro/issues/4147

   ### Search before asking
   
   - [x] I have searched in the [issues](https://github.com/apache/amoro/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What would you like to be improved?
   
   ### Description
   
   **Problem:**
   `CloseableIterator<Record>` instances are not properly closed in the position delete processing logic of `CombinedDeleteFilter` and `MixedDeleteFilter`, causing potential resource leaks.
   
   **Affected Code:**
   - `CombinedDeleteFilter.java:397-410` - `positionMap` initialization
   - `MixedDeleteFilter.java:369-386` - `positionMap` initialization
   
   ### Current Behavior
   
   The iterator is created but never explicitly closed:
   ```
   CloseableIterator<Record> iterator = CloseableIterable.concat(deletes).iterator();
   while (iterator.hasNext()) {
     // process records
   }
   // iterator is never closed
   ```
   
   ### Expected Behavior
   
   The iterator should be managed with try-with-resources to ensure proper cleanup:
   ```
   try (CloseableIterator<Record> iterator = CloseableIterable.concat(deletes).iterator()) {
     while (iterator.hasNext()) {
       // process records
     }
   } catch (IOException e) {
     throw new RuntimeException("Failed to close position delete iterator", e);
   }
   ```
   
   ### Impact
   - Memory leaks in long-running processes
   - File descriptor exhaustion under heavy workloads
   - Potential data corruption if underlying resources are not properly released
   
   ### Environment
   - Component: amoro-format-iceberg
   - Classes: CombinedDeleteFilter, MixedDeleteFilter
   
   
   ### How should we improve?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Subtasks
   
   _No response_
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscribe@amoro.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement]: Resource leak in CombinedDeleteFilter and MixedDeleteFilter position delete iterators [amoro]

Posted by "xxubai (via GitHub)" <gi...@apache.org>.
xxubai closed issue #4147: [Improvement]: Resource leak in CombinedDeleteFilter and MixedDeleteFilter position delete iterators
URL: https://github.com/apache/amoro/issues/4147


-- 
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: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org