FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-19466: Py_Finalize() clears daemon threads earlier by vstinner · Pull Request #18848 · python/cpython · GitHub

/ cpython Public

bpo-19466: Py_Finalize() clears daemon threads earlier - #18848

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:finalize_daemon_threads
Mar 9, 2020
Merged

bpo-19466: Py_Finalize() clears daemon threads earlier#18848
vstinner merged 1 commit into
python:masterfrom
vstinner:finalize_daemon_threads

Conversation

vstinner commented Mar 8, 2020
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Clear the frames of daemon threads earlier during the Python shutdown to
call objects destructors. So "unclosed file" resource warnings are now
emitted for daemon threads in a more reliable way.

Cleanup _PyThreadState_DeleteExcept() code: rename "garbage" to
"list".

https://bugs.python.org/issue19466

vstinner changed the title bpo-19466: Py_Finalize() clears daemon threads earlier [WIP] bpo-19466: Py_Finalize() clears daemon threads earlier Mar 8, 2020

vstinner commented Mar 8, 2020
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member Author

Oh, this change does not work as expected, it does introduce a crash, see:
https://bugs.python.org/issue19466#msg363654

It seems like the commit eb4e2ae (bpo-39877) introduced a race condition.

Comment thread Python/pylifecycle.c Outdated

vstinner commented Mar 9, 2020
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member Author

Oh, this change does not work as expected, it does introduce a crash, see:
https://bugs.python.org/issue19466#msg363654
It seems like the commit eb4e2ae (bpo-39877) introduced a race condition.

I wrote PR #18854 to fix this bug.

Clear the frames of daemon threads earlier during the Python shutdown to
call objects destructors. So "unclosed file" resource warnings are now
emitted for daemon threads in a more reliable way.

Cleanup _PyThreadState_DeleteExcept() code: rename "garbage" to
"list".
vstinner changed the title [WIP] bpo-19466: Py_Finalize() clears daemon threads earlier bpo-19466: Py_Finalize() clears daemon threads earlier Mar 9, 2020
vstinner merged commit 9ad58ac into python:master Mar 9, 2020
vstinner deleted the finalize_daemon_threads branch March 9, 2020 22:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL