Skip to content

Gracefully shutdown is hang while a SSE connection is established #493

@greenhat616

Description

@greenhat616

Describe the bug
While using streamable-http transport. The SseBody donnot handle the signal of gracefully shutdown, thus, blocking the shutdown process until client disconnect.

To Reproduce

  1. start the server
RUST_LOG=trace cargo run --example servers_counter_streamhtt
  1. create a client connection to server via @modelcontextprotocol/inspector

  2. press CTRL + C to trigger server exits

Image

I noted the sse transport has similar issue, but I don't dig it deep.

Expected behavior
While trigger cancelled, the server will exits immediately.

Logs
If applicable, add logs to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions