Search before asking
Paimon version
master @ 345526e
Compute Engine
Engine-agnostic (core)
Minimal reproduce step
Call FileIndexFormat.createReader(seekableInputStream, rowType) on a corrupt or wrong-version index file. FileIndexFormat.Reader.<init> (paimon-common FileIndexFormat.java lines 248-261) throws a RuntimeException from the magic check ("This file is not file index file.") or the version check, both inside the constructor's try block. The only catch (IOException e) (line 282) closes the owned stream, but a RuntimeException escapes it uncaught.
What doesn't meet your expectations?
Because the constructor throws before returning, the caller's try-with-resources never binds the Reader, so its close() never runs and the SeekableInputStream (a real file descriptor) leaks. The IOException path already closes it.
Anything else?
Fix: widen the catch to IOException | RuntimeException so the stream is closed on both failure paths, mirroring the existing IOException branch.
Are you willing to submit a PR?
Search before asking
Paimon version
master @ 345526e
Compute Engine
Engine-agnostic (core)
Minimal reproduce step
Call
FileIndexFormat.createReader(seekableInputStream, rowType)on a corrupt or wrong-version index file.FileIndexFormat.Reader.<init>(paimon-commonFileIndexFormat.javalines 248-261) throws aRuntimeExceptionfrom the magic check ("This file is not file index file.") or the version check, both inside the constructor'stryblock. The onlycatch (IOException e)(line 282) closes the owned stream, but aRuntimeExceptionescapes it uncaught.What doesn't meet your expectations?
Because the constructor throws before returning, the caller's try-with-resources never binds the
Reader, so itsclose()never runs and theSeekableInputStream(a real file descriptor) leaks. The IOException path already closes it.Anything else?
Fix: widen the catch to
IOException | RuntimeExceptionso the stream is closed on both failure paths, mirroring the existing IOException branch.Are you willing to submit a PR?