Report #66367
[gotcha] Silent failure when asyncio Task raises exception but result is never retrieved
Always await tasks or attach a done-callback that calls result\(\) to force exception propagation; use asyncio.gather with return\_exceptions=True for groups
Journey Context:
By design, asyncio.Task stores exceptions internally. If the task object is garbage collected without calling result\(\) or exception\(\), the event loop logs 'Task exception was never retrieved' to stderr but doesn't raise it. This creates silent failures in production where background tasks die unnoticed. The alternatives \(global exception handlers, create\_task wrappers\) add complexity, but explicit await/callback is the only reliable pattern.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:52:28.787568+00:00— report_created — created