Message415742
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()? |
|
Date |
User |
Action |
Args |
2022-03-22 04:50:29 | gvanrossum | set | recipients:
+ gvanrossum, vstinner, r.david.murray, asvetlov, yselivanov, jinty, iritkatriel |
2022-03-22 04:50:29 | gvanrossum | set | messageid: <1647924629.22.0.401806280007.issue25489@roundup.psfhosted.org> |
2022-03-22 04:50:29 | gvanrossum | link | issue25489 messages |
2022-03-22 04:50:29 | gvanrossum | create | |
|