Title: [3.7] bpo-36402: Fix threading._shutdown() race condition (GH-13948) by miss-islington · Pull Request #14034 · python/cpython · GitHub
Open Graph Title: [3.7] bpo-36402: Fix threading._shutdown() race condition (GH-13948) by miss-islington · Pull Request #14034 · python/cpython
X Title: [3.7] bpo-36402: Fix threading._shutdown() race condition (GH-13948) by miss-islington · Pull Request #14034 · python/cpython
Description: Fix a race condition at Python shutdown when waiting for threads. Wait until the Python thread state of all non-daemon threads get deleted (join all non-daemon threads), rather than just wait until Python threads complete. Add threading._shutdown_locks: set of Thread._tstate_lock locks of non-daemon threads used by _shutdown() to wait until all Python thread states get deleted. See Thread._set_tstate_lock(). Add also threading._shutdown_locks_lock to protect access to threading._shutdown_locks. Add test_finalization_shutdown() test. (cherry picked from commit 468e5fe) Co-authored-by: Victor Stinner vstinner@redhat.com https://bugs.python.org/issue36402
Open Graph Description: Fix a race condition at Python shutdown when waiting for threads. Wait until the Python thread state of all non-daemon threads get deleted (join all non-daemon threads), rather than just wait until...
X Description: Fix a race condition at Python shutdown when waiting for threads. Wait until the Python thread state of all non-daemon threads get deleted (join all non-daemon threads), rather than just wait until...
Opengraph URL: https://github.com/python/cpython/pull/14034
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ce90436b-f16a-811d-9249-955b92cf7cdc |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8EDC:15921E:132FD99:1BD2C32:6A5765F9 |
| html-safe-nonce | 785899c02f2e51a29ade5fffbac2d9653cfb6355bfb745c217d5ced682bf9ecd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RURDOjE1OTIxRToxMzJGRDk5OjFCRDJDMzI6NkE1NzY1RjkiLCJ2aXNpdG9yX2lkIjoiNzA4OTQ1MDMzMzk5MTU2MDY5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1ec30f70fd5c778c8b8fbf726f3fd45a67334ce96ef532716fa7616886d24e46 |
| hovercard-subject-tag | pull_request:287710859 |
| 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/14034/files |
| twitter:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| og:image:alt | Fix a race condition at Python shutdown when waiting for threads. Wait until the Python thread state of all non-daemon threads get deleted (join all non-daemon threads), rather than just wait until... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1b5a9c55f39dd27607a574cdc272552f20236b44 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width