[Bug] FileIndexFormat.Reader leaks input stream when construction fails with a runtime exception
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- java
- Ambito
- data-engineering
Direzione di ricerca
Inizia da FileIndexFormat.createReader e leggi le righe 248-261 e 282 di FileIndexFormat.java, concentrandoti sulla costruzione di Reader e sul percorso di cleanup esistente per IOException. Riproduci il problema con un file di indice corrotto o di versione errata, quindi verifica che anche gli errori RuntimeException durante la costruzione chiudano il SeekableInputStream di proprietà, mentre il comportamento esistente per IOException rimane invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Search before asking
- I searched in the issues and found nothing similar.
Paimon version
master @ 345526e26
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?
- I'm willing to submit a PR!
- Lingua principale
- Java
- Stelle
- 3.4k
- Fork
- 1.4k
- Merge medio
- 1g 14h
- PR unite (30g)
- 468
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/paimon
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
[Bug] [Hive] IndexOutOfBoundsException when converting an unavailable dynamic BETWEEN predicate Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Tutte le issue di apache/paimon
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
infinispan/infinispan#18150 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100