Title: Daemonic threads not killed in some circumstances in python 3.13 · Issue #123940 · python/cpython · GitHub
Open Graph Title: Daemonic threads not killed in some circumstances in python 3.13 · Issue #123940 · python/cpython
X Title: Daemonic threads not killed in some circumstances in python 3.13 · Issue #123940 · python/cpython
Description: Bug report Bug description: I got a bug report on python-zlib-ng where using the threaded opening the program would hang if an exception occurred and a context manager was not used. I fixed it by changing the threads to be daemonic: pyco...
Open Graph Description: Bug report Bug description: I got a bug report on python-zlib-ng where using the threaded opening the program would hang if an exception occurred and a context manager was not used. I fixed it by c...
X Description: Bug report Bug description: I got a bug report on python-zlib-ng where using the threaded opening the program would hang if an exception occurred and a context manager was not used. I fixed it by c...
Opengraph URL: https://github.com/python/cpython/issues/123940
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Daemonic threads not killed in some circumstances in python 3.13","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\nI got a [bug report](https://github.com/pycompression/python-zlib-ng/issues/53) on python-zlib-ng where using the threaded opening the program would hang if an exception occurred and a context manager was not used. \r\n\r\nI fixed it by changing the threads to be daemonic: https://github.com/pycompression/python-zlib-ng/pull/54. \r\n\r\nThis fixes the issue on python 3.9, 3.10, 3.11 and 3.12, but not 3.13-rc2. Also the latest main branch is affected. Unfortunately I could not create a minimal reproducer, other than running the test directly. Daemonic threads seem not to work in this particular case, where there are some BufferedIO streams and queues involved.\r\n\r\n\r\n```\r\ngit clone -b issue53 https://github.com/pycompression/python-zlib-ng\r\n# Build Cpython\r\n./python -m ensurepip\r\n./python -m pip install pytest pytest-timeout \u003cpath to python-zlib-ng repo\u003e\r\n./python -m pytest \u003cpath to python-zlib-ng repo\u003e/tests/test_gzip_ng_threaded.py::test_threaded_program_can_exit_on_error\r\n```\r\n\r\nSince there are many code changes between 3.12 in 3.13 the underlying cause is surely there, but it is hard to pinpoint.\r\n\r\n\r\n\r\n### CPython versions tested on:\r\n\r\n3.13, CPython main branch\r\n\r\n### Operating systems tested on:\r\n\r\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-124150\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/rhpvorderman","@type":"Person","name":"rhpvorderman"},"datePublished":"2024-09-11T09:58:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/123940/cpython/issues/123940"}
| 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:a2e052f0-3f55-83ae-6497-7448a690ad3d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE80:3A6082:70A065:9136BB:696AECCC |
| html-safe-nonce | 2f588469f45d6dd49f4a53162aaf3f6436c4f092d90f88e5b8c13f321313aa52 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTgwOjNBNjA4Mjo3MEEwNjU6OTEzNkJCOjY5NkFFQ0NDIiwidmlzaXRvcl9pZCI6IjUyMzg2ODAyOTY4NDcyNDAzOTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7c9d90c2f8d46b417b307d474fdaf393c2f91e95fbe09ce766153ab961c3610d |
| hovercard-subject-tag | issue:2519248842 |
| 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/123940/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6b6e855ff2ca242cc60b53a4cbe2af5e854580c80539b74695c2602a62e84292/python/cpython/issues/123940 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6b6e855ff2ca242cc60b53a4cbe2af5e854580c80539b74695c2602a62e84292/python/cpython/issues/123940 |
| og:image:alt | Bug report Bug description: I got a bug report on python-zlib-ng where using the threaded opening the program would hang if an exception occurred and a context manager was not used. I fixed it by c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rhpvorderman |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width