René's URL Explorer Experiment


Title: Response leak in SSE handlers · Issue #1450 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Response leak in SSE handlers · Issue #1450 · modelcontextprotocol/python-sdk

X Title: Response leak in SSE handlers · Issue #1450 · modelcontextprotocol/python-sdk

Description: I found a resource leak in the streamable HTTP client. When SSE streaming fails with an exception, the HTTP response isn't closed. Location: src/mcp/client/streamable_http.py: _handle_sse_response (line 336) _handle_resumption_request (l...

Open Graph Description: I found a resource leak in the streamable HTTP client. When SSE streaming fails with an exception, the HTTP response isn't closed. Location: src/mcp/client/streamable_http.py: _handle_sse_response ...

X Description: I found a resource leak in the streamable HTTP client. When SSE streaming fails with an exception, the HTTP response isn't closed. Location: src/mcp/client/streamable_http.py: _handle_sse_respo...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/1450

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Response leak in SSE handlers","articleBody":"I found a resource leak in the streamable HTTP client. When SSE streaming fails with an exception, the HTTP response isn't closed.\n\nLocation:\n`src/mcp/client/streamable_http.py`:\n- `_handle_sse_response` (line 336)\n- `_handle_resumption_request` (line 251)\n\nThe Issue:\npython\nasync def _handle_sse_response(self, response: httpx.Response, ...):\n    try:\n        event_source = EventSource(response)\n        async for sse in event_source.aiter_sse():\n            if is_complete:\n                await response.aclose()  # Only closed here\n                break\n    except Exception as e:\n        await ctx.read_stream_writer.send(e)\n        # response leaked!\n\nIf the SSE iteration raises an exception (malformed JSON, network error, etc.), the response is never closed.\n\nImpact:\nConnection pool gets exhausted in long-running clients, eventually causing new requests to hang or fail.\n\nFix:\ntry:\n    ...\nexcept Exception as e:\n    ...\nfinally:\n    await response.aclose()\n\nBoth methods need this fix.\n\nEnv:\nPython SDK version: 1.1.2 (or main branch)\nPython: 3.12\nTransport: StreamableHTTP","author":{"url":"https://github.com/certainly-param","@type":"Person","name":"certainly-param"},"datePublished":"2025-10-09T07:11:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1450/python-sdk/issues/1450"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7867afc0-e173-41f5-93fb-21308dac140e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA046:1451F7:10E5241:18A5F92:6A608E1D
html-safe-nonce3313d5f5d56d253c52cec823eef1ba089e31dbb4d6e4bcc69d2b2ae1fd4bda1c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDQ2OjE0NTFGNzoxMEU1MjQxOjE4QTVGOTI6NkE2MDhFMUQiLCJ2aXNpdG9yX2lkIjoiNjA3NTAwNjMyNzQyNDMyMzEwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaccb023269ebabe5cc4bcdf90ea7784b4137c44aa1fad26f992fd8545d47037c13
hovercard-subject-tagissue:3497915272
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/1450/issue_layout
twitter:imagehttps://opengraph.githubassets.com/820ce8c6b1ac8753624cbf8d4cdc39eaceb86f3c4f8b125c30eb60b559b5d4b3/modelcontextprotocol/python-sdk/issues/1450
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/820ce8c6b1ac8753624cbf8d4cdc39eaceb86f3c4f8b125c30eb60b559b5d4b3/modelcontextprotocol/python-sdk/issues/1450
og:image:altI found a resource leak in the streamable HTTP client. When SSE streaming fails with an exception, the HTTP response isn't closed. Location: src/mcp/client/streamable_http.py: _handle_sse_response ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecertainly-param
hostnamegithub.com
expected-hostnamegithub.com
Nonec0632c7929f76e8db538ffed06ab2fc4c524a012b0888e95d96928690fcc604d
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4f9009410bd92637ba907f71dc7f7af3f0df45aa
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/1450#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F1450
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F1450
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/1450
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/1450
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/1450
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/issues/1450
modelcontextprotocol https://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Fork 3.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Star 23.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Code https://github.com/modelcontextprotocol/python-sdk
Issues 267 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 312 https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality 6 https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Code https://github.com/modelcontextprotocol/python-sdk
Issues https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
#2633https://github.com/modelcontextprotocol/python-sdk/pull/2633
Response leak in SSE handlershttps://github.com/modelcontextprotocol/python-sdk/issues/1450#top
#2633https://github.com/modelcontextprotocol/python-sdk/pull/2633
P2Moderate issues affecting some users, edge cases, potentially valuable featurehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%22
needs reproneeds additional information to be able to reproduce bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22needs%20repro%22
ready for workEnough information for someone to start working onhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22ready%20for%20work%22
Resource leakshttps://github.com/modelcontextprotocol/python-sdk/milestone/26
https://github.com/certainly-param
certainly-paramhttps://github.com/certainly-param
on Oct 9, 2025https://github.com/modelcontextprotocol/python-sdk/issues/1450#issue-3497915272
P2Moderate issues affecting some users, edge cases, potentially valuable featurehttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%22
needs reproneeds additional information to be able to reproduce bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22needs%20repro%22
ready for workEnough information for someone to start working onhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22ready%20for%20work%22
Resource leaksNo due datehttps://github.com/modelcontextprotocol/python-sdk/milestone/26
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.