This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Andrew Lytvyn
Recipients Andrew Lytvyn, asvetlov, yselivanov
Date 2017-09-13.14:53:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1505314417.04.0.216091950997.issue31452@psf.upfronthosting.co.za>
In-reply-to
Content
If you do not await gather, then if one of gather inner coroutines fails, others keep working, but they should not.


```python
import asyncio
import logging

logging.basicConfig(level=logging.DEBUG)

loop = asyncio.get_event_loop()

async def success_coro(seconds):
    await asyncio.sleep(seconds)
    print(seconds)


async def failed_coro(seconds):
    await asyncio.sleep(seconds)
    print(seconds)
    raise ZeroDivisionError

coros = [
    success_coro(2),
    failed_coro(3),
    success_coro(5),
]

async def waiter():
    await asyncio.gather(*coros)

asyncio.ensure_future(waiter())

loop.run_forever()
```
-------------------------------------------------------------
Console:
2
3
ERROR:asyncio:Task exception was never retrieved
future: <Task finished coro=<waiter() done, defined at tst.py:72> exception=ZeroDivisionError()>
Traceback (most recent call last):
  File "tst.py", line 73, in waiter
    await asyncio.gather(*coros)
  File "tst.py", line 64, in failed_coro
    raise ZeroDivisionError
ZeroDivisionError
5
-------------------------------------------------------------

Expected behavior that 5 should not be printed.
History
Date User Action Args
2017-09-13 14:53:37Andrew Lytvynsetrecipients: + Andrew Lytvyn, asvetlov, yselivanov
2017-09-13 14:53:37Andrew Lytvynsetmessageid: <1505314417.04.0.216091950997.issue31452@psf.upfronthosting.co.za>
2017-09-13 14:53:36Andrew Lytvynlinkissue31452 messages
2017-09-13 14:53:36Andrew Lytvyncreate