➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 vstinner
收信人 Mark.Shannon, davin, ned.deily, pitrou, serhiy.storchaka, vstinner
日期 2018-05-23.11:57:11
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1527076631.43.0.682650639539.issue33612@psf.upfronthosting.co.za>
In-reply-to
内容
> Yes, simply removing the assertion feels more like a copout than an actual fix.

We are very close to the 3.7rc1, so I suggest to remove the assertion, just to get more time to fix the issue.

--

I agree that in a perfect world, Python should cleanup everything properly, but in the current world, daemon threads and fork are a mess full of corner cases like this one.

Python doesn't join daemonic threads at shutdown, so I don't see how Python could ensure that the state of the Python state of these daemonic threads is consistent (ready to be cleared). For fork, it seems like the issue is similar. A fork removes immediately all threads except of the thread which called fork. How would it be possible for Python to ensure that the Python state of the other destroyed threads is consistent?

tstate->exc_info is a new feature of Python 3.7, to fix bpo-25612. But I don't think that Python 3.6 is better to cleanup daemon threads at shutdown or to cleanup threads on fork. If you run the attached bug.py with python3.6 -v bug.py, I also see warnings:

PyThreadState_Clear: warning: thread still has a frame
PyThreadState_Clear: warning: thread still has a frame
PyThreadState_Clear: warning: thread still has a frame
PyThreadState_Clear: warning: thread still has a frame
历史
日期 用户 动作 参数
2018-05-23 11:57:11vstinner修改recipients: + vstinner, pitrou, ned.deily, Mark.Shannon, serhiy.storchaka, davin
2018-05-23 11:57:11vstinner修改messageid: <1527076631.43.0.682650639539.issue33612@psf.upfronthosting.co.za>
2018-05-23 11:57:11vstinner链接issue33612 messages
2018-05-23 11:57:11vstinner创建