Akanksha-kedia opened a new pull request, #19047:
URL: https://github.com/apache/pinot/pull/19047

   ## Description
   
   Fixes a resource leak in `HnswVectorIndexCreator` and `MutableVectorIndex` 
where an `FSDirectory` (backed by an OS file descriptor) was opened but not 
closed if the subsequent `IndexWriter` construction threw an exception.
   
   ### Problem
   `FSDirectory.open(path)` acquires a file-system lock and OS resources. If 
`new IndexWriter(directory, config)` throws (e.g. due to a codec error or 
corrupted segment), the `FSDirectory` was never closed, leaking the lock and 
file descriptor.
   
   ### Fix
   Wrap `IndexWriter` construction in a try-with-resources / try-catch that 
closes the `FSDirectory` on failure, ensuring the resource is always released.
   
   ## Test plan
   - [ ] Existing vector index tests pass
   - [ ] No functional behavior change on the happy path


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