TeeInputStream.close skips source cleanup when closing the destination fails

オープン 初心者向け
#329 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
83/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
backend

調査の方向性

org.eclipse.jgit/src/org/eclipse/jgit/util/io/TeeInputStream.javaを読み、特にリンク先の行付近にあるclose()を確認し、近くにあるストリームのテストを調べて、既存のクローズ処理と例外処理のパターンを確認してください。宛先のクローズで例外が発生するという報告されたケースを再現し、ドレイン時の失敗も確認してください。失敗後も両方のデリゲートに対する処理が試みられ、最初の例外が後続の例外を抑制した状態で呼び出し元に伝わり、テストでそれらのケースを網羅できたら完了です。

索引モデルが 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eclipse-jgit/jgit のほかの issue

eclipse-jgit/jgit の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。