Title: gh-150490: Raise PyType_Modified for insertion into split dictionary (take 2) by DinoV · Pull Request #152914 · python/cpython · GitHub
Open Graph Title: gh-150490: Raise PyType_Modified for insertion into split dictionary (take 2) by DinoV · Pull Request #152914 · python/cpython
X Title: gh-150490: Raise PyType_Modified for insertion into split dictionary (take 2) by DinoV · Pull Request #152914 · python/cpython
Description: Take 2 of #150489 - what's changed is that we now acquire the type lock in insert_split_key before we acquire the keys lock. We never do any work below the dictionary keys lock so we maintain an invariant that we don't have inverted lock acquisition leading to a deadlock. Also adds @nascheme's test case. ./python -m test --tsan-parallel --parallel-threads=4 -j4 -W` is no longer hanging. When we insert into a split dictionary we update the shared keys version - this is used to invalidate caches for loading methods and loading class values and requires us to check the keys version. Instead we can raise PyType_Modified which lets us rely on the type version check + has inline values check instead of validating that we have the correct keys version. This gets rid of loading the cached keys version, the objects type (although likely the compiler eliminates this already), loading the cached keys from the type, and then loading the keys version and comparing it against the cached value. Issue: gh-150490
Open Graph Description: Take 2 of #150489 - what's changed is that we now acquire the type lock in insert_split_key before we acquire the keys lock. We never do any work below the dictionary keys lock so we maintain a...
X Description: Take 2 of #150489 - what's changed is that we now acquire the type lock in insert_split_key before we acquire the keys lock. We never do any work below the dictionary keys lock so we mainta...
Opengraph URL: https://github.com/python/cpython/pull/152914
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9ef9013b-9ca7-9ac6-d701-3e0708097457 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C68C:1AF501:112FD01:16A6481:6A51A860 |
| html-safe-nonce | cb3e2d96fec8a910b993253f2d65a17894a3214ad9b05be12c393f2ee58fe843 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjhDOjFBRjUwMToxMTJGRDAxOjE2QTY0ODE6NkE1MUE4NjAiLCJ2aXNpdG9yX2lkIjoiNDk5MTYxNzY3MTg2OTA4MTY5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a48aadc6fe528532ae206b2eddf65715ff647bc3edb78c020a0814e093e98636 |
| hovercard-subject-tag | pull_request:3980618353 |
| 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/152914/files |
| twitter:image | https://avatars.githubusercontent.com/u/320265?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/320265?s=400&v=4 |
| og:image:alt | Take 2 of #150489 - what's changed is that we now acquire the type lock in insert_split_key before we acquire the keys lock. We never do any work below the dictionary keys lock so we maintain a... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width