TeeInputStream.close skips source cleanup when closing the destination fails
還沒有人認領這個 Issue。
評估
研究方向
閱讀 org.eclipse.jgit/src/org/eclipse/jgit/util/io/TeeInputStream.java,尤其是連結行附近的 close(),並檢查相鄰串流的測試,了解現有的關閉與例外處理模式。重現目標串流關閉時擲出例外的回報案例,並檢查排空時的失敗。完成條件是:發生失敗後仍會嘗試呼叫兩個委派物件;第一個例外會傳遞給呼叫端,後續例外會以 suppressed 形式附加;測試涵蓋這些情況。
由索引模型根據 Issue 內容生成。
描述
Version
JGit 7.8.1.202611041320-r, OpenJDK 21, macOS.
Bug description
When a caller closes a TeeInputStream, it drains the remaining input, closes the destination, and then closes the source. An exception from the destination's close() skips the source's close(). An exception during the drain skips both close calls. TeeInputStream.close() in 7.8.1
Actual behavior
I checked the public wrapper directly using an empty in-memory input and an in-memory output. With both delegates closing normally, each received one close call. When the output's close method threw an IOException, the wrapper propagated that exception and the input received zero close calls.
Expected behavior
After attempting the drain, the wrapper should attempt to close both delegates even if an earlier operation failed. The first failure should reach the caller, with any later close failures available as suppressed exceptions.
AI assistance was used to prepare this report.
- 主要語言
- Java
- 星號
- 427
- 分支
- 116
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
eclipse-jgit/jgit 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 77/100
eclipse-jgit/jgit#327 ·
-
Repository.create(boolean bare) should provide a no-arg overload that uses isBare()可能重新可做 @hardikyadav12 於 77 天前認領,目前沒有進行中的 PR。 未關閉
難度 2/5 1-3 小時 新手友好度 74/100
eclipse-jgit/jgit#297 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 83/100
eclipse-jgit/jgit#293 · 2 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 72/100
eclipse-jgit/jgit#288 ·
-
難度 2/5 1-3 小時 新手友好度 72/100
eclipse-jgit/jgit#273 · 1 則留言 ·
查看 eclipse-jgit/jgit 的全部 Issue
相似的 Issue
-
? - Needs Triage bot_watch bug
難度 2/5 1-3 小時 新手友好度 78/100
NVIDIA/cudf-spark-jni#5594 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 92/100
-
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
bug
難度 1/5 1 小時以內 新手友好度 88/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
DataONEorg/dataone-indexer#390 ·