AnyIOStream.write leaks EndOfStream #1045
Unanswered
Miksus
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm facing an issue of
anyio.EndOfStreamexception slips through the exception map inAnyIOStream.writeinhttpcore/_backends/anyio.py. Based on this issue #808, it seems thereadmethod was fixed from the same error by addingEndOfStreamto the exception map in the read. Perhaps the write method could be fixed the same way by modifying this map?I'm not 100% sure if this is a httpcore issue or bug in the other dependencies though as I'm not too familiar with the topic. I use httpx-ws which uses httpcore underneath.
httpx-wswould catch this if it wasWriteErrorand notEndOfStreamerror so if theEndOfStreamerror was added to the exception map in httpcore I wouldn't get this issue. My guess is that this is casued by pinging, perhaps the ping writes to a closed stream or the ping closes the stream?Here is the traceback for the httpcore part:
In case it is relevant, here is what I did with
httpx-ws:The full traceback (this is in TaskGroup):
Feel free to point to httpx-ws in case this does not seem to be httpcore issue.
Beta Was this translation helpful? Give feedback.
All reactions