bpo-38379: don't claim objects are collected when they aren't #16658
Conversation
nothing is actually collected in this run of gc. Change the stats to relect that truth.
LGTM. I don't think the performance impact is significant either and the stats are wrong without this fix. |
There is no performance hit here - that would come with the second half of the bpo suggestions, if gc were taught how to keep on collecting despite that a finalizer resurrected some trash. As is (with or without this PR so far), gc gives up after detecting a resurrection. Which leads to the test case on the bpo issue, where trash keeps on building up forever and gc never make progress. |
@tim-one: Please replace |
Thanks @tim-one for the PR |
I'm having trouble backporting to |
Sorry, @tim-one, I could not cleanly backport this to |
Thanks @tim-one for the PR |
Sorry @tim-one, I had trouble checking out the |
I have no idea how to backport this (well - or anything else). I installed
So I'm giving up before I do real harm |
GH-16683 is a backport of this pull request to the 3.8 branch. |
…ythonGH-16658) * bpo-38379: when a finalizer resurrects an object, nothing is actually collected in this run of gc. Change the stats to relect that truth. (cherry picked from commit ecbf35f) Co-authored-by: Tim Peters <tim.peters@gmail.com>
…ythonGH-16658) * bpo-38379: when a finalizer resurrects an object, nothing is actually collected in this run of gc. Change the stats to relect that truth.. (cherry picked from commit ecbf35f) Co-authored-by: Tim Peters <tim.peters@gmail.com>
GH-16685 is a backport of this pull request to the 3.7 branch. |
…ythonGH-16658) * bpo-38379: when a finalizer resurrects an object, nothing is actually collected in this run of gc. Change the stats to relect that truth.. (cherry picked from commit ecbf35f) Co-authored-by: Tim Peters <tim.peters@gmail.com>
…H-16658) (GH-16683) * [bpo-38379](https://bugs.python.org/issue38379): when a finalizer resurrects an object, nothing is actually collected in this run of gc. Change the stats to relect that truth. (cherry picked from commit ecbf35f) Co-authored-by: Tim Peters <tim.peters@gmail.com> https://bugs.python.org/issue38379 Automerge-Triggered-By: @pablogsal
…H-16658) (GH-16685) * [bpo-38379](https://bugs.python.org/issue38379): when a finalizer resurrects an object, nothing is actually collected in this run of gc. Change the stats to relect that truth.. (cherry picked from commit ecbf35f) Co-authored-by: Tim Peters <tim.peters@gmail.com> https://bugs.python.org/issue38379 Automerge-Triggered-By: @pablogsal
…#16658) * bpo-38379: when a finalizer resurrects an object, nothing is actually collected in this run of gc. Change the stats to relect that truth.
When a finalizer resurrects an object, nothing is actually collected in this run of gc. Change the stats to reflect that truth.
https://bugs.python.org/issue38379
Automerge-Triggered-By: @tim-one
The text was updated successfully, but these errors were encountered: