Repository navigation
Commit 664e6f5
authored
HttpClientStreamableTransport: fix race condition on 404 response (#1306)
- There was a race condition where a 404 to a sendMessage call triggered
client-side session closing. This would ultimately close the reactive
chain representing HTTP 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 562f0d3 commit 664e6f5
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