Commit 2d33ade
committed
Raise CONNECTION_CLOSED for requests sent after the connection closed
send_raw_request raised RuntimeError both before run() and after the
transport closed, contradicting the documented contract that connection
loss surfaces as MCPError(CONNECTION_CLOSED). A closed flag now separates
the two states: RuntimeError remains for use before run(), and a request
after EOF gets the same CONNECTION_CLOSED error the in-flight waiters
receive.1 parent 421e65b commit 2d33ade
3 files changed
Lines changed: 29 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1186 | 1186 | | |
1187 | 1187 | | |
1188 | 1188 | | |
1189 | | - | |
| 1189 | + | |
1190 | 1190 | | |
1191 | 1191 | | |
1192 | 1192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| |||
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
273 | | - | |
| 274 | + | |
274 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
275 | 279 | | |
276 | | - | |
| 280 | + | |
277 | 281 | | |
278 | 282 | | |
279 | 283 | | |
| |||
399 | 403 | | |
400 | 404 | | |
401 | 405 | | |
| 406 | + | |
402 | 407 | | |
403 | 408 | | |
404 | 409 | | |
| |||
407 | 412 | | |
408 | 413 | | |
409 | 414 | | |
| 415 | + | |
410 | 416 | | |
411 | 417 | | |
412 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1221 | 1221 | | |
1222 | 1222 | | |
1223 | 1223 | | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
1224 | 1244 | | |
1225 | 1245 | | |
1226 | 1246 | | |
| |||
0 commit comments