InvalidStateError on output stream close in BiDi API
- Vorherrschende Sprache
- Python
- Sterne
- 169
- Forks
- 19
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 11
Beschreibung
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"")
```
Beitragsleitfaden
Rechercherichtung
Search for CRTResponseBody._on_complete and inspect how the output stream's future is completed during close. Reproduce the BiDi API output-stream close path, then verify that closing it no longer raises InvalidStateError when the future is cancelled.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- api
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 72/100