Check async cleanup, cross-thread submission, worker state and cancellation lifetime.
Review the related lessons
- Python AsyncExitStack: unwind acquired resources after a later open fails
- Python asyncio loop callbacks: submit from a worker with call_soon_threadsafe
- Python thread-local state: a reused pool worker retains the previous job's value
- Python eager asyncio tasks: a coroutine can finish before create_task returns
- Python weakref.finalize: run an idempotent cleanup callback once
- Python RLock: permit nested ledger methods without dropping the outer lock
- Python run_coroutine_threadsafe: submit to a live loop and own shutdown
- Python asyncio.to_thread cancellation: the blocking worker can outlive its awaiter
Common Mistakes
A local event ordering test is not a stress test of a shared service.
