Repository navigation
Commit 600c377
committed
HttpClientStreamableTransport: fix race condition on 404 response
- There was a race condition where a 404 to a sendMessage call triggered
client-side session closing. This would ultimately close open
connections, including the POST for the sendMessage itself if it had
not completed by then. This would cancel the Mono instead of
propagating the error.
- This was a race condition because before closing the connection, the
DefaultMcpTransportSession needed to send a DELETE to the server, and
waited for the response. Cancelling happened only when DELETE finished
before sendMessage() finished, so it would not show often.
- This materialized in CI as errors for `test404WithSessionId`.
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>1 parent 0e1a78f commit 600c377
1 file changed
Lines changed: 7 additions & 0 deletions
File tree
- mcp-core/src/main/java/io/modelcontextprotocol/client/transport
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
593 | 600 | | |
594 | 601 | | |
595 | 602 | | |
| |||
0 commit comments