Skip to content
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

bpo-38379: don't claim objects are collected when they aren't #16658

Merged
merged 6 commits into from Oct 9, 2019

Conversation

@tim-one
Copy link
Member

@tim-one tim-one commented Oct 8, 2019

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

nothing is actually collected in this run of gc.
Change the stats to relect that truth.
Lib/test/test_gc.py Show resolved Hide resolved
@nascheme
Copy link
Member

@nascheme nascheme commented Oct 8, 2019

LGTM. I don't think the performance impact is significant either and the stats are wrong without this fix.

@tim-one
Copy link
Member Author

@tim-one tim-one commented Oct 8, 2019

I don't think the performance impact is significant either

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.

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Oct 9, 2019

@tim-one: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 9, 2019

Thanks @tim-one for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒🤖

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 9, 2019

I'm having trouble backporting to 3.8. Reason: 'Error 110 while writing to socket. Connection timed out.'. Please retry by removing and re-adding the needs backport to 3.8 label.

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 9, 2019

Sorry, @tim-one, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker ecbf35f9335b0420cb8adfda6f299d6747a16515 3.7

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 9, 2019

Thanks @tim-one for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 9, 2019

Sorry @tim-one, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker ecbf35f9335b0420cb8adfda6f299d6747a16515 3.8

@tim-one
Copy link
Member Author

@tim-one tim-one commented Oct 9, 2019

I have no idea how to backport this (well - or anything else). I installed cherry_picker and ran the suggested commands, but even in --dry-run mode they blow up with stuff like

subprocess.CalledProcessError: Command '['git', 'log', '-r', 'ecbf35f']' returned non-zero exit status 128.

So I'm giving up before I do real harm ☹️

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Oct 9, 2019

GH-16683 is a backport of this pull request to the 3.8 branch.

pablogsal added a commit to pablogsal/cpython that referenced this issue Oct 9, 2019
…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>
pablogsal added a commit to pablogsal/cpython that referenced this issue Oct 9, 2019
…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>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Oct 9, 2019

GH-16685 is a backport of this pull request to the 3.7 branch.

pablogsal added a commit to pablogsal/cpython that referenced this issue Oct 9, 2019
…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>
miss-islington added a commit that referenced this issue Oct 9, 2019
…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
miss-islington added a commit that referenced this issue Oct 9, 2019
…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
jacobneiltaylor added a commit to jacobneiltaylor/cpython that referenced this issue Dec 5, 2019
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants