Skip to content

[Server] Fix stdio answering a request on an idle connection only after ~50ms - #575

Open
chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix-stdio-idle-latency
Open

chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix-stdio-idle-latency

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

The stdio loop slept 50ms whenever no complete line was there, so a sequential client got ~20 calls/s at most.

  • Wait on the input with stream_select() instead, still capped at 50ms so fibers, streams and queued messages get their tick
  • Non-selectable streams like php://memory fall back to the sleep

Fixes chr-hertel#63

🤖 Generated with Claude Code

@chr-hertel chr-hertel added this to the 0.9.0 milestone Oct 10, 2026
@chr-hertel chr-hertel added bug Something isn't working Server Issues & PRs related to the Server component labels Oct 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server] stdio answers a lone request only after ~50 ms

1 participant