You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Akanksha-kedia (via GitHub)" <gi...@apache.org> on 2026/07/22 11:07:50 UTC
[PR] Fix FSDirectory resource leak when IndexWriter construction fails [pinot]
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Fix FSDirectory resource leak when IndexWriter construction fails [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on PR #19047:
URL: https://github.com/apache/pinot/pull/19047#issuecomment-5208362299
Duplicate of #18964
--
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@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Fix FSDirectory resource leak when IndexWriter construction fails [pinot]
Posted by "Akanksha-kedia (via GitHub)" <gi...@apache.org>.
Akanksha-kedia commented on PR #19047:
URL: https://github.com/apache/pinot/pull/19047#issuecomment-5045087530
cc @Jackie-Jiang @richardstartin — would appreciate a review when you get a chance!
--
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@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Fix FSDirectory resource leak when IndexWriter construction fails [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang closed pull request #19047: Fix FSDirectory resource leak when IndexWriter construction fails
URL: https://github.com/apache/pinot/pull/19047
--
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@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org