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 gvanrossum
Recipients asvetlov, gvanrossum, iritkatriel, jinty, r.david.murray, vstinner, yselivanov
Date 2022-03-22.04:50:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647924629.22.0.401806280007.issue25489@roundup.psfhosted.org>
In-reply-to
Content
Andrew, thanks for explaining this.

The key thing I was missing was that the root cause of the problem is that Future.__del__ is trying to log an error about the un-awaited task by calling the exception handler directly. That actually feels a little dodgy.

This is why I'm not yet comfortable with (d). Looking at call_exception_handler(), whether it calls the default handler or a custom handler, it explicitly checks for SystemExit and KeyboardInterrupt and re-raises those. And only those -- everything ends up logging an error.

Which makes me wonder. Maybe that error in Future.__del__ should not call any exception handler at all, but just call logger.error()? Or maybe Future.__del__ should catch exceptions coming out of there and log an error? Maybe a modified version of (d), but only implemented in Future.__del__, not in call_exception_handler()?
History
Date User Action Args
2022-03-22 04:50:29gvanrossumsetrecipients: + gvanrossum, vstinner, r.david.murray, asvetlov, yselivanov, jinty, iritkatriel
2022-03-22 04:50:29gvanrossumsetmessageid: <1647924629.22.0.401806280007.issue25489@roundup.psfhosted.org>
2022-03-22 04:50:29gvanrossumlinkissue25489 messages
2022-03-22 04:50:29gvanrossumcreate