Skip to content

bpo-38962: Fix reference leak in the per-subinterpreter gc - #17457

Merged
miss-islington merged 2 commits into
python:masterfrom
pablogsal:bpo-38962-4
Dec 4, 2019
Merged

bpo-38962: Fix reference leak in the per-subinterpreter gc#17457
miss-islington merged 2 commits into
python:masterfrom
pablogsal:bpo-38962-4

Conversation

@pablogsal

@pablogsalpablogsal commented Dec 3, 2019

Copy link
Copy Markdown
Member

@pablogsal

Copy link
Copy Markdown
MemberAuthor

I'm not super convinced about this PR, but indeed it fixes the reference leaks in test__xxsubinterpreters (when all other PRs in https://bugs.python.org/issue38962 are applied first):

❯ ./python -m test test__xxsubinterpreters -R :
0:00:00 load avg: 1.10 Run tests sequentially
0:00:00 load avg: 1.10 [1/1] test__xxsubinterpreters
beginning 9 repetitions
123456789
.........

== Tests result: SUCCESS ==

1 test OK.

Total duration: 17.6 sec
Tests result: SUCCESS

Comment threadPython/pylifecycle.c Outdated
@pablogsal

Copy link
Copy Markdown
MemberAuthor

@vstinner I have modified the PR to trigger the collection only on sub interpreters. Can you check it out?

Comment threadPython/pylifecycle.c Outdated
@pablogsal
pablogsalforce-pushed the bpo-38962-4 branch 2 times, most recently from 0e8f8c5 to 4f9a89bCompareDecember 4, 2019 11:29

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

As I wrote, I'm not fully satisfied by calling _PyGC_CollectNoFail() after PyInterpreterState_Clear() because of the risk of bugs in objects finalizers, but we cannot fix all Python finalization issues at once. Let's unblock the buildbots, and only later investigate for a better design.

@miss-islington

Copy link
Copy Markdown
Contributor

@pablogsal: Status check is done, and it's a success ✅ .

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pablogsal@miss-islington@vstinner@the-knights-who-say-ni@bedevere-bot