Commit 80d1386
committed
fix(client): propagate HTTP transport exceptions to caller
ROOT CAUSE:
In SSE and StreamableHTTP transports, when HTTP errors occur or other
exceptions are raised in post_writer, exceptions are caught and logged
but never sent to read_stream_writer, causing the caller to hang
indefinitely waiting for a response that will never arrive.
CHANGES:
- sse.py: Send exceptions from post_writer to read_stream_writer
- streamable_http.py: Send exceptions from post_writer to read_stream_writer
IMPACT:
This prevents callers from hanging when HTTP errors occur in the
transport layer, ensuring exceptions are properly propagated to the
caller for handling.
FILES MODIFIED:
- src/mcp/client/sse.py
- src/mcp/client/streamable_http.py
Reported-by: gspeter
Github-Issue: #21101 parent 0fe16dd commit 80d1386
2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
| 481 | + | |
482 | 482 | | |
| 483 | + | |
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
| |||
0 commit comments