Files
Max Isbey 54f02edde4 fix: propagate pre-endpoint errors in sse_client instead of deadlocking
When sse_reader encounters an error before receiving the endpoint event,
the except handler tried to send the exception to read_stream_writer.
With a zero-buffer stream and no reader (the caller is still blocked in
tg.start() waiting for task_status.started()), send() blocks forever.

Track whether started() has fired. Before it, re-raise so the exception
propagates through tg.start(). After it, send to the stream as before.

This also adds a guard for the case where a server sends a message event
before the endpoint event, which would deadlock on the same send() call.

The dedicated SSEError handler from #975 is removed since the started
flag now handles all pre-endpoint exceptions uniformly.

Github-Issue: #447
2026-03-24 22:39:38 +00:00
..
2024-09-24 22:04:19 +01:00
2025-02-05 11:02:51 +00:00