Content-Length: 273527 | pFad | http://github.com/modelcontextprotocol/python-sdk/pull/2654

39 fix: buffer stdio server writes during progress notifications by 2830500285 · Pull Request #2654 · modelcontextprotocol/python-sdk · GitHub
Skip to content

fix: buffer stdio server writes during progress notifications#2654

Open
2830500285 wants to merge 1 commit into
modelcontextprotocol:mainfrom
2830500285:fix-stdio-progress-deadlock
Open

fix: buffer stdio server writes during progress notifications#2654
2830500285 wants to merge 1 commit into
modelcontextprotocol:mainfrom
2830500285:fix-stdio-progress-deadlock

Conversation

@2830500285
Copy link
Copy Markdown

Summary

  • buffer the server stdio write stream by one message so a handler can queue its final response while stdout is still flushing an earlier notification
  • add a regression test covering a slow notification write followed by a response send

Fixes #1141.

Validation

  • uv run --frozen --no-sync pytest tests/server/test_stdio.py tests/shared/test_progress_notifications.py -q
  • uv run --frozen --no-sync ruff format --check src/mcp/server/stdio.py tests/server/test_stdio.py
  • uv run --frozen --no-sync ruff check src/mcp/server/stdio.py tests/server/test_stdio.py
  • uv run --frozen --no-sync pyright src/mcp/server/stdio.py tests/server/test_stdio.py

Note: local uv run --frozen sync attempted to fetch the git dependency strict-no-cover, but GitHub fetches for that dependency were failing from this machine. I used the already-synced virtualenv with --no-sync for the targeted checks above.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Progress notifications cause server to hang on stdio transport

1 participant









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/modelcontextprotocol/python-sdk/pull/2654

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy