dkranchii opened a new pull request, #19925: URL: https://github.com/apache/pinot/pull/19925
`OffHeapJsonIndexCreator` opens the posting list output stream in its constructor but closes it only in `seal()`. The inherited `BaseJsonIndexCreator.close()` just deletes the temp directory, so when `add()` throws (for example on a malformed json record with `continueOnError` disabled) `seal()` is never reached and the file descriptor leaks for the lifetime of the JVM. This overrides `close()` to close the stream and then delegate to `super.close()`, mirroring the existing `OffHeapH3IndexCreator.close()`. Closing a `DataOutputStream` twice is a no-op, so the normal `seal()`-then-`close()` path is unaffected. ### Testing Added `JsonIndexTest#testOffHeapCreatorCloseWithoutSeal`, covering close-after-failed-add (temp directory cleaned up, repeated `close()` safe) and the normal seal-then-close path. ### Compatibility No config, API, or on-disk format change. -- 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]
