gh-148450: abc.register needs to update type_version when tp_flags is changed.#148623
Conversation
|
This looks correct to me. Setting flags means that caches based on the type version should be invalidated. You can't call Minor improvement suggestion: I would adjust the comment to explain that ideally the setting of flags and clearing (invalidation) of version would be done in one step. However, because the version invalidation must be done with the world not stopped, we need to do these two steps. Regarding the 3.13 backport: the code is different in that version, there is no stop-the-world done. With 3.13, there are data races on on tp_flags (since they are read without a lock and without atomics). For the backport, you would just not worry about that and call |
|
Thanks for the review! For the backup to 3.13, since automatic backups aren't working, should I create a new PR to fix this issue? |
I'm not a pro on cpython github mechanics but I think making a new PR is fine. If you look at an auto backported PR, you can see the structure of the title. Should refer to the original PR number. |
|
(Keep the label just for triaging and history) |
|
The good looks good in principle, but I'm not too familiar with the FT locking mechanisms. |
|
Thanks @cocolato for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
|
Sorry, @cocolato and @kumaraditya303, I could not cleanly backport this to |
|
Sorry, @cocolato and @kumaraditya303, I could not cleanly backport this to |
|
Thanks @cocolato for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-150300 is a backport of this pull request to the 3.15 branch. |
|
GH-150308 is a backport of this pull request to the 3.14 branch. |
abc.registerchangestp_flagswithout updatingtype_version#148450