-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-111623 Serialize tuples with sub interpreters #111628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Requesting a review from @ericsnowcurrently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: tuples can contain mutable objects and objects that cannot be shared. What will happen in this case?
It will raise a |
Misc/NEWS.d/next/Core and Builtins/2023-11-02-15-00-57.gh-issue-111623.BZxYc8.rst
Outdated
Show resolved
Hide resolved
…e-111623.BZxYc8.rst Co-authored-by: Pieter Eendebak <[email protected]>
Co-authored-by: Pieter Eendebak <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I think you've got this right. I just have a few minor comments, and a possible small adjustment to how you are doing allocation.
I'm also pretty sure you have a number of memory leaks here. Be sure to check by running ./python -m test test__xxsubinterpreters -R 3:3
. I've left a number of recommendations that should clean up the leaks.
for s in non_shareables: | ||
value = tuple([0, 1., s]) | ||
with self.subTest(repr(value)): | ||
# XXX Assert the NotShareableError when it is exported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll work on that.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Co-authored-by: Eric Snow <[email protected]>
Co-authored-by: Eric Snow <[email protected]>
Co-authored-by: Eric Snow <[email protected]>
Co-authored-by: Eric Snow <[email protected]>
Co-authored-by: Eric Snow <[email protected]>
Co-authored-by: Eric Snow <[email protected]>
Co-authored-by: Eric Snow <[email protected]>
I have made the requested changes; please review again |
I've lost this feedback, was it to change the structure to be closer to PyTuple's |
Should recursion limit checks be added? It's unlikely, but I think it is possible to create a cyclically recursive tuple, at least via the C API. |
It's not possible in Python, but it wouldn't hurt incase there were some other container type added to this module in future |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looking good. I only have a few comments.
Don't worry about this. |
Co-authored-by: Eric Snow <[email protected]>
Co-authored-by: Eric Snow <[email protected]>
|
Crashing in the negative case because of the test function: if (_PyObject_GetCrossInterpreterData(obj, data) != 0) {
_PyCrossInterpreterData_Free(data);
return NULL;
} This is calling
I could move |
…reed memory space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'll merge this first thing (my) tomorrow. |
|
The buildbot failure appears to be another case of gh-109700. |
Closes #111623