| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Thanks for the PR! #1960 is still labeled needs repro — could you post a reproduction on that issue first so we can confirm the root cause before reviewing a fix? The PR description here mentions reordering cleanup but the diff just widens the except clause, so a repro on the issue would help us verify which approach is actually correct. |
Sorry, something went wrong.
|
I posted a runnable repro on #1960. You were also right that the PR body drifted from the current diff. I'll update the PR description so it matches the implementation before asking for another review. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Problem
stdio_client() starts background tasks that read process stdout and forward messages into a zero-buffer memory stream. If the caller exits the context without consuming read_stream, stdout_reader can block on read_stream_writer.send(...).
Before this change, the cleanup path closed read_stream_writer while stdout_reader was still running inside the task group. That raises anyio.BrokenResourceError and surfaces as an ExceptionGroup during context exit.
Fix
The cleanup sequence now cancels the task group before any of the memory streams it owns are closed. The stream handles are closed only after the task group has exited, so stdout_reader and stdin_writer are no longer racing against stream teardown.
Validation