Title: asyncio.Runner+PidfdChildWatcher leaves zombie processes · Issue #95899 · python/cpython · GitHub
Open Graph Title: asyncio.Runner+PidfdChildWatcher leaves zombie processes · Issue #95899 · python/cpython
X Title: asyncio.Runner+PidfdChildWatcher leaves zombie processes · Issue #95899 · python/cpython
Description: import asyncio import sys import unittest import asyncio asyncio.set_child_watcher(asyncio.PidfdChildWatcher()) def create_free_port(): return 4 # chosen by a fair dice roll class TestProc(unittest.IsolatedAsyncioTestCase): async def asy...
Open Graph Description: import asyncio import sys import unittest import asyncio asyncio.set_child_watcher(asyncio.PidfdChildWatcher()) def create_free_port(): return 4 # chosen by a fair dice roll class TestProc(unittest...
X Description: import asyncio import sys import unittest import asyncio asyncio.set_child_watcher(asyncio.PidfdChildWatcher()) def create_free_port(): return 4 # chosen by a fair dice roll class TestProc(unittest...
Opengraph URL: https://github.com/python/cpython/issues/95899
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"asyncio.Runner+PidfdChildWatcher leaves zombie processes","articleBody":"```python\r\nimport asyncio\r\nimport sys\r\nimport unittest\r\n\r\nimport asyncio\r\n\r\nasyncio.set_child_watcher(asyncio.PidfdChildWatcher())\r\n\r\n\r\ndef create_free_port():\r\n return 4 # chosen by a fair dice roll\r\n\r\n\r\nclass TestProc(unittest.IsolatedAsyncioTestCase):\r\n async def asyncSetUp(self):\r\n self.port = create_free_port()\r\n self.proc = await asyncio.create_subprocess_exec(\r\n sys.executable,\r\n \"-c\", # more realistically this might be an http server or database\r\n f\"import time; print('listening on {self.port}'); import time; time.sleep(2); print('goodbye')\",\r\n )\r\n\r\n async def testProc(self):\r\n print(f\"connecting to {self.port}\")\r\n\r\n async def asyncTearDown(self):\r\n await self.proc.communicate() # hangs forever on 3.11\r\n\r\n\r\nif __name__ == \"__main__\":\r\n unittest.main()\r\n```\r\n\r\non python3.10 this produces:\r\n\r\n```\r\nconnecting to 4\r\nlistening on 4\r\ngoodbye\r\n.\r\n----------------------------------------------------------------------\r\nRan 1 test in 2.022s\r\n\r\nOK\r\n```\r\n\r\non python3.11 it hangs forever in `await self.proc.communicate()`\r\n\r\n_Originally posted by @graingert in https://github.com/python/cpython/issues/95736#issuecomment-1211736028_","author":{"url":"https://github.com/kumaraditya303","@type":"Person","name":"kumaraditya303"},"datePublished":"2022-08-11T18:48:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/95899/cpython/issues/95899"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:24c46322-76d1-d6a4-0f2e-0b20e653c382 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A218:378C0F:128C72B:19C2E41:696A93C7 |
| html-safe-nonce | ee90aba327d610204377b6fb61e3acf84bf427dd889f8c385909f94b16678a10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjE4OjM3OEMwRjoxMjhDNzJCOjE5QzJFNDE6Njk2QTkzQzciLCJ2aXNpdG9yX2lkIjoiMTI4NTQyNjA0Nzk2NzkzNzk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d2c1d66bdb3f0a38ecf42338b95b911911c8b9d2787655756ace6a03b365f37b |
| hovercard-subject-tag | issue:1336356023 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/95899/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d317c30259ab999f4b3fa15f18cd7db5512d3d219eba2d83cf5213b918e1c829/python/cpython/issues/95899 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d317c30259ab999f4b3fa15f18cd7db5512d3d219eba2d83cf5213b918e1c829/python/cpython/issues/95899 |
| og:image:alt | import asyncio import sys import unittest import asyncio asyncio.set_child_watcher(asyncio.PidfdChildWatcher()) def create_free_port(): return 4 # chosen by a fair dice roll class TestProc(unittest... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kumaraditya303 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4dd496afc954da9c207b2d9fbe86e3074619f565754aa1d9274aec30d9e5b8d7 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 31496a13b80a2f6ad77d6c617ee2255a3545b539 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width