Title: bpo-40115: Fix refleak in test_asyncio by aeros · Pull Request #19282 · python/cpython · GitHub
Open Graph Title: bpo-40115: Fix refleak in test_asyncio by aeros · Pull Request #19282 · python/cpython
X Title: bpo-40115: Fix refleak in test_asyncio by aeros · Pull Request #19282 · python/cpython
Description: My change to remove daemon threads in concurrent.futures (#19149) revealed a subtle issue in test_events.test_run_in_executor_cancel: it does not properly clean up the executor's resources. This should be done by calling loop.shutdown_default_executor() prior to loop.close(), as is done in asyncio.run(). Before: [aeros:~/repos/aeros-cpython]$ ./python -m test --fail-env-changed -R 3:3 test_asyncio -m test.test_asyncio.test_events.EPollEventLoopTests.test_run_in_executor_cancel 0:00:00 load avg: 0.63 Run tests sequentially 0:00:00 load avg: 0.63 [1/1] test_asyncio beginning 6 repetitions 123456 ...... test_asyncio leaked [1, 1, 1] references, sum=3 test_asyncio leaked [2, 1, 1] memory blocks, sum=4 test_asyncio failed == Tests result: FAILURE == 1 test failed: test_asyncio Total duration: 3.2 sec Tests result: FAILURE After: [aeros:~/repos/aeros-cpython]$ ./python -m test --fail-env-changed -R 3:3 test_asyncio -m test.test_asyncio.test_events.EPollEventLoopTests.test_run_in_executor_cancel 0:00:00 load avg: 0.24 Run tests sequentially 0:00:00 load avg: 0.24 [1/1] test_asyncio beginning 6 repetitions 123456 ...... == Tests result: SUCCESS == 1 test OK. Total duration: 3.5 sec Tests result: SUCCESS /cc @vstinner @pitrou @1st1 https://bugs.python.org/issue40115
Open Graph Description: My change to remove daemon threads in concurrent.futures (#19149) revealed a subtle issue in test_events.test_run_in_executor_cancel: it does not properly clean up the executor's resources. Thi...
X Description: My change to remove daemon threads in concurrent.futures (#19149) revealed a subtle issue in test_events.test_run_in_executor_cancel: it does not properly clean up the executor's resources....
Opengraph URL: https://github.com/python/cpython/pull/19282
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:053bff99-031f-bb2b-9267-b22d6914613c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C0FC:CD446:18B24FC:22448E8:6A4EB786 |
| html-safe-nonce | cc9b35d012d490b8354fe0784f8834c8053b6066e332eb0492fdaa8eff7dc965 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEZDOkNENDQ2OjE4QjI0RkM6MjI0NDhFODo2QTRFQjc4NiIsInZpc2l0b3JfaWQiOiIxNjg2MDc4OTI5NTM2NzI2OTE4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f21bde2ac532f8aaf693dee25180c36fdcc2f3feb03450893c748bc718bf3ce5 |
| hovercard-subject-tag | pull_request:397221224 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/19282/files |
| twitter:image | https://avatars.githubusercontent.com/u/44193521?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/44193521?s=400&v=4 |
| og:image:alt | My change to remove daemon threads in concurrent.futures (#19149) revealed a subtle issue in test_events.test_run_in_executor_cancel: it does not properly clean up the executor's resources. Thi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width