René's URL Explorer Experiment


Title: Asyncio stream doesn't handle exceptions in callback · Issue #110894 · python/cpython · GitHub

Open Graph Title: Asyncio stream doesn't handle exceptions in callback · Issue #110894 · python/cpython

X Title: Asyncio stream doesn't handle exceptions in callback · Issue #110894 · python/cpython

Description: Bug report Bug description: Consider the following server that always just crashes: import asyncio async def handle_echo(reader, writer): raise Exception("I break everything") async def main(): server = await asyncio.start_server( handle...

Open Graph Description: Bug report Bug description: Consider the following server that always just crashes: import asyncio async def handle_echo(reader, writer): raise Exception("I break everything") async def main(): ser...

X Description: Bug report Bug description: Consider the following server that always just crashes: import asyncio async def handle_echo(reader, writer): raise Exception("I break everything") async def m...

Opengraph URL: https://github.com/python/cpython/issues/110894

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Asyncio stream doesn't handle exceptions in callback","articleBody":"# Bug report\n\n### Bug description:\n\nConsider the following server that always just crashes:\n```python\nimport asyncio\n\nasync def handle_echo(reader, writer):\n    raise Exception(\"I break everything\")\n\nasync def main():\n    server = await asyncio.start_server(\n        handle_echo, '127.0.0.1', 8888)\n    async with server:\n        await server.serve_forever()\n\nasyncio.run(main(), debug=True)\n```\nTogether with the following client:\n```python\nimport asyncio\n\nasync def tcp_echo_client(message):\n    reader, writer = await asyncio.open_connection(\n        '127.0.0.1', 8888)\n\n    data = await reader.read(100)\n    print(data)\n    writer.close()\n    await writer.wait_closed()\n    print(\"closed\")\n\nasyncio.run(tcp_echo_client('Hello World!'), debug=True)\n```\nWhen running this in Python 3.8, the server prints a `Task exception was never retrieved` message with an exception. I guess this is acceptable. However, the connection is never closed, and the client is kept hanging. That should not happen in my opinion.\n\nFurthermore, in newer Python versions, due to https://github.com/python/cpython/pull/96323, the internal task is being kept alive indefinitely. Therefore, the `Task exception was never retrieved` message is only printed when you kill the server. Otherwise, the failure is completely silent. This is extremely counter-intuitive behavior.\n\n### CPython versions tested on:\n\n3.11\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-111601\n* gh-111632\n* gh-111634\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/LasseBlaauwbroek","@type":"Person","name":"LasseBlaauwbroek"},"datePublished":"2023-10-15T11:59:38Z","url":"https://github.com/python/cpython/issues/110894"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b01df7b2-cafe-0703-9539-044fe69aacde
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB512:1F5C:79A28A:A1BF9A:6B0211D0
html-safe-noncefab06dd8475cf9efddc35a418e33d052feaccc8b16908e12bb6cd832a4453ca1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTEyOjFGNUM6NzlBMjhBOkExQkY5QTo2QjAyMTFEMCIsInZpc2l0b3JfaWQiOiI3ODAyNDc5MjkwOTkzNDgwMTQ0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb615e27d02b655e00f5c12f43708c772be4c8ca6ecba0a7613182d91876d7ad6
hovercard-subject-tagissue:1943860249
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/python/cpython/110894/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d6b9b1b25bbf5badeee6a7869e6134ddb86357bbee2cc686f2a8928834130889/python/cpython/issues/110894
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d6b9b1b25bbf5badeee6a7869e6134ddb86357bbee2cc686f2a8928834130889/python/cpython/issues/110894
og:image:altBug report Bug description: Consider the following server that always just crashes: import asyncio async def handle_echo(reader, writer): raise Exception("I break everything") async def main(): ser...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameLasseBlaauwbroek
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/110894#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F110894
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F110894
Sign uphttps://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=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/110894
Reloadhttps://github.com/python/cpython/issues/110894
Reloadhttps://github.com/python/cpython/issues/110894
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/110894
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/110894
#111601https://github.com/python/cpython/pull/111601
Asyncio stream doesn't handle exceptions in callbackhttps://github.com/python/cpython/issues/110894#top
#111601https://github.com/python/cpython/pull/111601
https://github.com/kumaraditya303
3.11only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.11%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
topic-asynciohttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-asyncio%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/LasseBlaauwbroek
LasseBlaauwbroekhttps://github.com/LasseBlaauwbroek
on Oct 15, 2023https://github.com/python/cpython/issues/110894#issue-1943860249
#96323https://github.com/python/cpython/pull/96323
GH-110894: Call loop exception handler for exceptions in client_connected_cb #111601https://github.com/python/cpython/pull/111601
[3.12] GH-110894: Call loop exception handler for exceptions in client_connected_cb (GH-111601) #111632https://github.com/python/cpython/pull/111632
[3.11] [3.12] GH-110894: Call loop exception handler for exceptions in client_connected_cb (GH-111601) (GH-111632) #111634https://github.com/python/cpython/pull/111634
LasseBlaauwbroekhttps://github.com/LasseBlaauwbroek
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Oct 15, 2023https://github.com/python/cpython/issues/110894#event-10657519805
AlexWaygoodhttps://github.com/AlexWaygood
topic-asynciohttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-asyncio%22
on Oct 15, 2023https://github.com/python/cpython/issues/110894#event-10657531342
github-project-automationhttps://github.com/apps/github-project-automation
asynciohttps://github.com/orgs/python/projects/29
on Oct 15, 2023https://github.com/python/cpython/issues/110894#event-14883417588
github-project-automationhttps://github.com/apps/github-project-automation
asynciohttps://github.com/orgs/python/projects/29
on Oct 15, 2023https://github.com/python/cpython/issues/110894
LasseBlaauwbroekhttps://github.com/LasseBlaauwbroek
on Oct 15, 2023https://github.com/python/cpython/issues/110894#event-10657619295
Handle exceptions from server callbackshttps://github.com/LasseBlaauwbroek/pycapnp/commit/1a72d3f0f27e5905350a7c7602619e71fcfdaaf4
1a72d3fhttps://github.com/LasseBlaauwbroek/pycapnp/commit/1a72d3f0f27e5905350a7c7602619e71fcfdaaf4
https://github.com/LasseBlaauwbroek
LasseBlaauwbroekhttps://github.com/LasseBlaauwbroek
on Oct 15, 2023https://github.com/python/cpython/issues/110894#issuecomment-1763383576
PyCapnphttps://github.com/capnproto/pycapnp
capnproto/pycapnp#337https://github.com/capnproto/pycapnp/pull/337
haatahttps://github.com/haata
on Oct 23, 2023https://github.com/python/cpython/issues/110894#event-10736247338
Handle exceptions from server callbackshttps://github.com/capnproto/pycapnp/commit/ca8d12090108a863014aee5ad2a11747963964c9
ca8d120https://github.com/capnproto/pycapnp/commit/ca8d12090108a863014aee5ad2a11747963964c9
https://github.com/kumaraditya303
kumaraditya303https://github.com/kumaraditya303
on Nov 1, 2023https://github.com/python/cpython/issues/110894#issuecomment-1789020506
#111601https://github.com/python/cpython/pull/111601
kumaraditya303https://github.com/kumaraditya303
GH-110894: Call loop exception handler for exceptions in client_connected_cb #111601https://github.com/python/cpython/pull/111601
on Nov 2, 2023https://github.com/python/cpython/issues/110894#event-10840160772
kumaraditya303https://github.com/kumaraditya303
on Nov 2, 2023https://github.com/python/cpython/issues/110894#event-10840177642
kumaraditya303https://github.com/kumaraditya303
3.11only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.11%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
on Nov 2, 2023https://github.com/python/cpython/issues/110894#event-10840178274
kumaraditya303https://github.com/kumaraditya303
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#111601https://github.com/python/cpython/pull/111601
on Nov 2, 2023https://github.com/python/cpython/issues/110894#event-10840352212
github-project-automationhttps://github.com/apps/github-project-automation
asynciohttps://github.com/orgs/python/projects/29
on Nov 2, 2023https://github.com/python/cpython/issues/110894
kumaraditya303https://github.com/kumaraditya303
on Nov 2, 2023https://github.com/python/cpython/issues/110894#event-10840352652
GH-110894: Call loop exception handler for exceptions in client_conne…https://github.com/python/cpython/commit/229f44d353c71185414a072017f46f125676bdd6
GH-110894https://github.com/python/cpython/issues/110894
229f44dhttps://github.com/python/cpython/commit/229f44d353c71185414a072017f46f125676bdd6
[3.12] pythonGH-110894: Call loop exception handler for exceptions in…https://github.com/kumaraditya303/cpython/commit/f9d55b8d96e0efe76280edbab68aa8383bf2eaf3
pythonGH-110894https://github.com/python/cpython/issues/110894
f9d55b8https://github.com/kumaraditya303/cpython/commit/f9d55b8d96e0efe76280edbab68aa8383bf2eaf3
[3.12] pythonGH-110894: Call loop exception handler for exceptions in…https://github.com/kumaraditya303/cpython/commit/d68da953ddc06a82b532ff4a8fcfc46996edfaa7
pythonGH-110894https://github.com/python/cpython/issues/110894
d68da95https://github.com/kumaraditya303/cpython/commit/d68da953ddc06a82b532ff4a8fcfc46996edfaa7
[3.12] GH-110894: Call loop exception handler for exceptions in clien…https://github.com/python/cpython/commit/9aa88290d82e2808eed84e7a63d0bf9623f84f53
GH-110894https://github.com/python/cpython/issues/110894
9aa8829https://github.com/python/cpython/commit/9aa88290d82e2808eed84e7a63d0bf9623f84f53
miss-islingtonhttps://github.com/miss-islington
on Nov 2, 2023https://github.com/python/cpython/issues/110894#event-10840701768
[3.12] pythonGH-110894: Call loop exception handler for exceptions in…https://github.com/miss-islington/cpython/commit/42db293616a5b7b49e40a045d71edf965530ed96
pythonGH-110894https://github.com/python/cpython/issues/110894
42db293https://github.com/miss-islington/cpython/commit/42db293616a5b7b49e40a045d71edf965530ed96
FullteaRhttps://github.com/FullteaR
on Nov 3, 2023https://github.com/python/cpython/issues/110894#event-10852437323
pythonGH-110894: Call loop exception handler for exceptions in client…https://github.com/FullteaR/cpython/commit/d4898b2a77fedc1c3b2e904df5dddb1d1e9fbece
pythonGH-110894https://github.com/python/cpython/issues/110894
d4898b2https://github.com/FullteaR/cpython/commit/d4898b2a77fedc1c3b2e904df5dddb1d1e9fbece
vstinnerhttps://github.com/vstinner
on Nov 4, 2023https://github.com/python/cpython/issues/110894#event-10861543064
[3.11] [3.12] GH-110894: Call loop exception handler for exceptions i…https://github.com/python/cpython/commit/f7ffe4a8eac64dedd2950e334f870a5c111e4be7
GH-110894https://github.com/python/cpython/issues/110894
f7ffe4ahttps://github.com/python/cpython/commit/f7ffe4a8eac64dedd2950e334f870a5c111e4be7
aiskhttps://github.com/aisk
on Feb 11, 2024https://github.com/python/cpython/issues/110894#event-11766812159
pythonGH-110894: Call loop exception handler for exceptions in client…https://github.com/aisk/cpython/commit/b217c64123832f25dc4dcaadb7fc546d1804ab35
pythonGH-110894https://github.com/python/cpython/issues/110894
b217c64https://github.com/aisk/cpython/commit/b217c64123832f25dc4dcaadb7fc546d1804ab35
Glyphackhttps://github.com/Glyphack
on Sep 2, 2024https://github.com/python/cpython/issues/110894#event-14106073618
pythonGH-110894: Call loop exception handler for exceptions in client…https://github.com/Glyphack/cpython/commit/5f64dabc491f1c7ce0b1ab8a2a724a5d3ed0a209
pythonGH-110894https://github.com/python/cpython/issues/110894
5f64dabhttps://github.com/Glyphack/cpython/commit/5f64dabc491f1c7ce0b1ab8a2a724a5d3ed0a209
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/110894
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/110894
kumaraditya303https://github.com/kumaraditya303
3.11only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.11%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
topic-asynciohttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-asyncio%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
asynciohttps://github.com/orgs/python/projects/29
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.