Streamable HTTP POST can stay open after request timeout or cancellation

Aperta
#1,351 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java
Ambito
networking

Direzione di ricerca

Start at mcp-core/src/main/java/io/modelcontextprotocol/client/transport/HttpClientStreamableHttpTransport.java around lines 545-591, where the request-scoped POST subscription is created. Reproduce with a local MCP test server that answers POST with text/event-stream and withholds the JSON-RPC response, then time out or dispose the caller and check whether the response body subscription is cancelled. Read related #1133 for pending response cleanup. Done means timeout or cancellation releases the POST and body while the client remains usable for other requests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug description

In MCP Java SDK 2.2.0, a request-scoped POST from the legacy HttpClientStreamableHttpTransport can remain active after its caller times out or cancels. The HTTP exchange has its own subscription, and cancellation of the caller does not reach it. Transport source in v2.2.0

Steps to reproduce

Have a local MCP test server answer a POST with text/event-stream and keep the stream open without sending the matching JSON-RPC response. Let the client request time out or dispose the request subscription while the stream is open. Observe whether the POST response body is cancelled.

Expected behavior

Timeout or cancellation releases the pending POST and its response body while leaving the client available for other requests.

Related: #1133 tracks cleanup of pending response entries.

Lingua principale
Java
Stelle
3.8k
Fork
1.1k
Merge medio
1g 3h
PR unite (30g)
38

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/java-sdk

Tutte le issue di modelcontextprotocol/java-sdk

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.