Report #6567
[gotcha] asyncio Task disappears mid-execution without error or cancellation
Store the Task object returned by create\_task\(\) in a variable, list, or attribute until it completes; do not call create\_task\(\) and ignore the return value
Journey Context:
create\_task schedules a coroutine as a Task. The event loop holds only a weak reference to the Task. If the user code doesn't hold a reference, the Task becomes eligible for garbage collection. When GC runs, the Task is destroyed, the coroutine never finishes, and no exception is raised. This silently drops async work.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:21:25.320309+00:00— report_created — created