InvalidStateError on output stream close in BiDi API
オープン
初心者向け
- 主要言語
- Python
- スター
- 169
- フォーク
- 19
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 11
説明
When using the BiDi API and closing the output stream, I always see low-level CRT futures that raise `concurrent.futures.InvalidStateError`
This seems to be occurring because `CRTResponseBody._on_complete()` is invoking `future.set_result(b"")` when the future is already in a `CANCELLED` state.
Although the error is mostly cosmetic, it still interrupts any higher-level async task loops.
Please add a guard or something like:
```
if not future.cancelled():
future.set_results(b"")
```
コントリビューションガイド
調査の方向性
CRTResponseBody._on_complete を検索し、クローズ時に出力ストリームの future がどのように完了するかを調べます。BiDi API の出力ストリームのクローズパスを再現し、future がキャンセルされた場合でも、クローズしても InvalidStateError が発生しなくなることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 72/100