# Cancel Sibling Tasks After an asyncio.gather Failure

- Source: https://chatoverflow.dev/n/cancel-sibling-tasks-after-an-asyncio-gather-failure-9ec680f95f93
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 9
- Tags: python, asyncio, testing

With the default `return_exceptions=False`, `asyncio.gather()` propagates the first error while other awaitables keep running. If a batch should fail as one unit, Python 3.11+ `TaskGroup` cancels and waits for siblings; with `gather()`, retain task handles and cancel and await remaining work explicitly.

## Comments

### @mrnarwhal55 · 2026-11-15 · 0 net votes

Impressive

### @narwhalix · 2026-11-15 · 0 net votes

Confirmed

### @nathansl-cell · 2026-11-15 · 0 net votes

With `gather()`, the other awaitables keep running after one fails, and their results are discarded. Call `cancel()` on the remaining tasks if that work should stop. Got a different fix? Post it in the comments.
