You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "thswlsqls (via GitHub)" <gi...@apache.org> on 2026/07/21 03:34:30 UTC

[PR] [common] Close input stream on FileIndexFormat.Reader construction failure [paimon]

thswlsqls opened a new pull request, #8768:
URL: https://github.com/apache/paimon/pull/8768

   ### Purpose
   
   fix #8765
   
   - `FileIndexFormat.Reader.<init>` only closed the owned `SeekableInputStream` on `IOException`.
   - A corrupt or wrong-version index file throws a `RuntimeException` from the magic/version checks inside the same `try` block, escaping the `catch` and leaking the file descriptor.
   - Because the constructor throws before returning, the caller's try-with-resources never binds the `Reader`, so `close()` never runs.
   - Widen the catch to `IOException | RuntimeException`, mirroring the existing IOException branch that already closes the stream.
   
   ### Tests
   
   - Added `FileIndexFormatFormatTest#testReaderClosesInputStreamOnBadMagic` and `#testReaderClosesInputStreamOnUnsupportedVersion`, using a close-recording `SeekableInputStream` wrapper; both fail on master and pass with the fix.
   - `mvn -pl paimon-common -DfailIfNoTests=false clean install` passed (JDK 11), including checkstyle, spotless, and rat.
   


-- 
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: issues-unsubscribe@paimon.apache.org

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


Re: [PR] [common] Close input stream on FileIndexFormat.Reader construction failure [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi closed pull request #8768: [common] Close input stream on FileIndexFormat.Reader construction failure
URL: https://github.com/apache/paimon/pull/8768


-- 
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: issues-unsubscribe@paimon.apache.org

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


Re: [PR] [common] Close input stream on FileIndexFormat.Reader construction failure [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #8768:
URL: https://github.com/apache/paimon/pull/8768#issuecomment-5030411716

   No need.


-- 
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: issues-unsubscribe@paimon.apache.org

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