[issue31452] asyncio.gather does not cancel tasks if one fails

2017-10-19 Thread Yury Selivanov
Yury Selivanov added the comment: I'm going to reject this issue as it's not backwards compatible. I'll work on adding a new TaskGroup primitive in the next couple of days that would address this problem. -- resolution: -> rejected stage: patch review -> resolved status: open -> clo

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-22 Thread Guido van Rossum
Guido van Rossum added the comment: > if you change run_forever with run_until_complete, then behavior changes: > success_coro(5) will not be executed Oh, that's a red herring. The reason is that the event loop stops when you use run_complete(), but the execution of success_coro(5) is still pe

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-22 Thread Andrew Lytvyn
Andrew Lytvyn added the comment: Guido, look. The point is that if you change run_forever with run_until_complete, then behavior changes: success_coro(5) will not be executed. I think that it's strange that behavior differs depending on entrypoint: run_forever or run_untill_complete -

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-21 Thread Yury Selivanov
Yury Selivanov added the comment: > I'm afraid I no longer have all the details of this design in my head, and I > have no idea what the fix does (and no time to read up on everything). Let's say we have three tasks: t1, t2, t3. Then we use gather on them: await gather(t1, t2, t3) Let's s

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-21 Thread Guido van Rossum
Guido van Rossum added the comment: I'm afraid I no longer have all the details of this design in my head, and I have no idea what the fix does (and no time to read up on everything). The OP says "If you do not await gather" -- what happens if you *do* await it? Do the tasks then get killed?

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-21 Thread Yury Selivanov
Yury Selivanov added the comment: I looked at the PR, and I'm not so sure about this change. In short, it can be viewed as a backwards incompatible change to asyncio.gather. Guido, what do you think? -- nosy: +gvanrossum ___ Python tracker

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-15 Thread Krzysztof Warunek
Krzysztof Warunek added the comment: I hit the same thing. Also there is a PR patch -- nosy: +kwarunek ___ Python tracker ___ ___ Pyt

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-15 Thread Krzysztof Warunek
Changes by Krzysztof Warunek : -- keywords: +patch pull_requests: +3588 stage: needs patch -> patch review ___ Python tracker ___ ___

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-14 Thread Yury Selivanov
Yury Selivanov added the comment: Andrew, looks like it. You can take a look if you want (I don't have time to work on this right now). -- ___ Python tracker ___ _

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-14 Thread Andrew Svetlov
Andrew Svetlov added the comment: Yuri, it looks like a serious bug. I expected `success_coro(5)` cancelling but see print out. -- components: +Library (Lib) stage: -> needs patch versions: +Python 3.7 ___ Python tracker

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-13 Thread Andrew Lytvyn
New submission from Andrew Lytvyn: 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(seco