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.

Author tim.peters
Recipients Kevin Shweh, SnoopJeDi, bjs, eryksun, pitrou, serhiy.storchaka, tim.peters, vstinner
Date 2022-02-13.04:31:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644726701.8.0.607022763188.issue46726@roundup.psfhosted.org>
In-reply-to
Content
While bundling the lock.release() into C makes that bulletproof, is there a bulletproof way to guarantee that `self._stop()` gets called if the acquire_and_release() succeeds? Offhand, I don't see a reason for why that isn't just as vulnerable to getting skipped due to an unfortunate signal.

Indeed, huge mounds of threading.py can leave things in insane states in the presence of by-magic exceptions. Even if code is very careful to put crucial cleanup code in `finally` blocks so it gets executed "no matter what", there's nothing to stop code in `finally` blocks from getting skipped over due to by-magic exceptions too.

It's an eternal marvel that anything ever works at all ;-)
History
Date User Action Args
2022-02-13 04:31:41tim.peterssetrecipients: + tim.peters, pitrou, vstinner, serhiy.storchaka, eryksun, Kevin Shweh, bjs, SnoopJeDi
2022-02-13 04:31:41tim.peterssetmessageid: <1644726701.8.0.607022763188.issue46726@roundup.psfhosted.org>
2022-02-13 04:31:41tim.peterslinkissue46726 messages
2022-02-13 04:31:41tim.peterscreate