hardConceptCodingDesignMidSeniorStaff
You run ten coroutines concurrently and one of them raises. What happens to the other nine?
5 min readUpdated 2026-08-15
Answer
Short answer
With gather they keep running unsupervised and their failures may surface as an unretrieved-exception warning.11, cancels the siblings, waits for them to finish unwinding, and raises an ExceptionGroup you handle with except*.
Mention task groups where it changes the risk, the owner, or the next check. A useful task groups point should make the answer more testable, not merely longer.
Was this answer helpful?
Likely follow-ups
- Why does return_exceptions=True change what the caller sees but not what the tasks do?
- What is asyncio.shield for, and what does it not protect against?
- How does asyncio.timeout know to raise TimeoutError rather than propagating CancelledError?
- What does the "Task exception was never retrieved" warning actually mean?
Related questions
- What does the GIL actually prevent, and how do you decide between threads, processes, and asyncio?mediumAlso on asyncio4 min
- A client hangs up halfway through a request. How do you structure a Go HTTP service so it stops doing the work?mediumAlso on cancellation7 min
- You stream the model's answer token by token to the browser. What does that change about error handling, guardrails and cost?hardAlso on cancellation5 min
- A client disconnects but your server keeps working on their request. How does cancellation actually propagate in .NET?mediumAlso on cancellation4 min