InvalidStateError on output stream close in BiDi API
未关闭
适合新手
- 主要语言
- Python
- 星标
- 169
- 派生
- 19
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 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