Streamable HTTP POST can stay open after request timeout or cancellation

Đang mở
#1,351 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
50/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
networking

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
3.8k
Fork
1.1k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
38

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của modelcontextprotocol/java-sdk

Tất cả issue của modelcontextprotocol/java-sdk

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.