Repository navigation
Commit f7bb652
committed
fix(mcp): abort hanging connections to non-standard servers
Add AbortController support to remote MCP transports (StreamableHTTP
and SSE) to prevent indefinite hangs when servers send malformed
responses or stall during handshake.
- Pass AbortSignal to transport requestInit for native fetch abort
- Set timeout to abort connections after configured timeout
- Ensure cleanup on all error paths (timeout, error, success)
Fixes anomalyco#84061 parent f9fcdea commit f7bb652
1 file changed
Lines changed: 25 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
322 | 325 | | |
323 | 326 | | |
| 327 | + | |
324 | 328 | | |
325 | 329 | | |
326 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
327 | 333 | | |
328 | 334 | | |
329 | 335 | | |
330 | 336 | | |
| 337 | + | |
331 | 338 | | |
332 | 339 | | |
333 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
334 | 343 | | |
335 | 344 | | |
336 | 345 | | |
337 | 346 | | |
338 | 347 | | |
339 | 348 | | |
340 | | - | |
| 349 | + | |
341 | 350 | | |
342 | 351 | | |
343 | 352 | | |
344 | 353 | | |
345 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
346 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
347 | 367 | | |
348 | 368 | | |
349 | 369 | | |
350 | 370 | | |
351 | 371 | | |
352 | 372 | | |
| 373 | + | |
353 | 374 | | |
354 | 375 | | |
355 | 376 | | |
| |||
0 commit comments