pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


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

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

0bd78641c0a1f3e0.css" /> fix(streamable-http): reduce stateless termination log noise by BlocksecPHD · Pull Request #2357 · modelcontextprotocol/python-sdk · GitHub
Skip to content

fix(streamable-http): reduce stateless termination log noise#2357

Open
BlocksecPHD wants to merge 3 commits intomodelcontextprotocol:mainfrom
BlocksecPHD:fix/stateless-termination-log-2329
Open

fix(streamable-http): reduce stateless termination log noise#2357
BlocksecPHD wants to merge 3 commits intomodelcontextprotocol:mainfrom
BlocksecPHD:fix/stateless-termination-log-2329

Conversation

@BlocksecPHD
Copy link
Copy Markdown

Summary

This PR adjusts termination logging in StreamableHTTPServerTransport for stateless mode.

  • Keep INFO log for stateful session termination (session id exists)
  • Emit DEBUG log for stateless transport cleanup (mcp_session_id is None)
  • Update wording to reflect normal request completion in stateless mode

This addresses confusion reported in #2329 where users interpret Terminating session: None as an error condition.

Changes

  • src/mcp/server/streamable_http.py
    • Conditional log level/message in terminate()
  • tests/server/test_streamable_http_manager.py
    • Add regression test to assert:
      • debug message exists for stateless cleanup
      • info-style Terminating session: None message is not emitted

Validation

Ran targeted tests locally:

python -m pytest tests/server/test_streamable_http_manager.py \
  -k 'stateless_requests_memory_cleanup or stateless_termination_logs_debug_not_info'

Result: 2 passed

@km-anthropic
Copy link
Copy Markdown

@claude review

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.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy