-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-35983: skip trashcan for subclasses #11841
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
d3a2746
to
7c4c52d
Compare
e7769b0
to
9b0b137
Compare
LGTM, but let another core dev review this before merge. @pitrou could you please take a look? |
Please consider backporting this to 2.7 and 3.7 |
Any news? |
I was asked for review. Unfortunately this is a hairy topic and I would have to take a dive to make a proper review. Depending how confident other core developers are, this could be merged anyway. @1st1, @serhiy-storchaka what do you think? @scoder perhaps you'd like to take a look? |
(PS: one issue with the trashcan mechanism is that it triggers rarely, so any bugs may occur only in obscure conditions that we don't have access to...) |
I'm absolutely not an expert in this area, but several things speak in favour of Jeroen's change:
My vote is for merging it and allowing users to find problems during the alpha/beta cycle. Several major projects have integration builds with the latest CPython master branch these days. |
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.
Here is a review after all.
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 |
If you all agree, please remove the |
@serhiy-storchaka is the last one that needs approving. |
Btw, if we are confident enough this could be a backport candidate. |
By https://discuss.python.org/t/vote-to-promote-stefan-behnel-as-a-core-developer/1054 it looks like this will have positive reviews from no less than 4 core developers. So @serhiy-storchaka could you please say more concretely why you do not approve? |
I'm seeing actual crashes caused by this on Python 2.7, so I'm interested in backporting to 2.7. The patch doesn't apply cleanly on top of 2.7, but I'm willing to work on that. |
@serhiy-storchaka If you don't mind, I will merge this soon. |
I think @benjaminp will have to decide whether this is 2.7-backport-worthy or not. |
... The body of the deallocator goes here, including all calls ... | ||
... to Py_DECREF on contained objects. ... | ||
Py_TRASHCAN_SAFE_END(p) | ||
Py_TRASHCAN_END // there should be no code after this |
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.
Why Py_TRASHCAN_SAFE_END has been renamed to Py_TRASHCAN_END? Is it not safe anymore?
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.
Why Py_TRASHCAN_SAFE_END has been renamed to Py_TRASHCAN_END? Is it not safe anymore?
I changed the signature, so I had to change the name too. Py_TRASHCAN_BEGIN
and Py_TRASHCAN_END
then seemed like the most logical names.
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.
Could not you preserve the signature of Py_TRASHCAN_SAFE_END? This would minimize changes.
Having two sets of names with and without SAFE gives false hint that the SAFE pair is more preferable.
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.
Could not you preserve the signature of Py_TRASHCAN_SAFE_END?
Of course I could, but what's the point of passing an argument which is not used?
This would minimize changes.
Why is that a goal? My goal is producing a good and simple trashcan implementation, not to minimize changes.
Having two sets of names with and without SAFE gives false hint that the SAFE pair is more preferable.
When reading the comments in the code (the only place where these are documented), it's clear that one should use Py_TRASHCAN_BEGIN
and that Py_TRASHCAN_SAFE_BEGIN
is only meant for backwards compatibility.
This is all bikeshedding of course and I don't really care much about the name and the unused arguments. So, if you have a concrete proposal that you're willing to accept, just say it.
ping? |
I'll let @serhiy-storchaka answer your last questions. |
There's no need to hold this up any longer. I'm merging. |
Thanks for being persistent @jdemeyer :-) |
https://bugs.python.org/issue35983