gh-111623 Serialize tuples with sub interpreters#111628
gh-111623 Serialize tuples with sub interpreters#111628ericsnowcurrently merged 34 commits intopython:mainfrom
Conversation
|
Requesting a review from @ericsnowcurrently |
sobolevn
left a comment
There was a problem hiding this comment.
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
…o serialize_tuples
…e-111623.BZxYc8.rst Co-authored-by: Pieter Eendebak <[email protected]>
Co-authored-by: Pieter Eendebak <[email protected]>
ericsnowcurrently
left a comment
There was a problem hiding this comment.
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 |
|
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 |
…o serialize_tuples
ericsnowcurrently
left a comment
There was a problem hiding this comment.
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
|
I'll merge this first thing (my) tomorrow. |
|
|
The buildbot failure appears to be another case of gh-109700. |
Closes #111623