Skip to content

SSE messages get lost when channel is full #2389

@eleftherias

Description

@eleftherias

Bug description

When an SSE MCP server / proxy and the message channel is full, then messages can get stuck.
The error that appears is:

Failed to send pending message to client X (channel full)

https://discord.com/channels/1184987096302239844/1358845587189006367/1432784566783049769

Steps to reproduce

Connect a MCP client to an SSE server and send several messages. Disconnect before receiving the responses.

Additional context

The issue appears to be:

  1. When channel is full, ToolHive returns BEFORE clearing the pending messages
  2. The pending messages stay in the queue
  3. The next client that connects tries to receive the messages
  4. This creates a stuck state where:
    - Pending messages accumulate indefinitely
    - Every new client connection fails to drain them
    - The error keeps repeating
    - New messages keep getting added to the queue

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingproxy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions