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 alex.gronholm
Recipients ajoino, alex.gronholm, asvetlov, gvanrossum, iritkatriel, jab, njs, tinchester, yselivanov
Date 2022-02-17.00:18:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645057083.88.0.499394918378.issue46771@roundup.psfhosted.org>
In-reply-to
Content
I just tried to write a snippet to demonstrate the issue in TaskGroup, but that doesn't seem possible since TaskGroup never swallows a CancelledError. It always raises/propagates _some_ exception out of __aexit__() unless of course all the child tasks run to completion successfully.

I was also surprised to notice that TaskGroup doesn't have a .cancel() method, so in cases where one would launch multiple tasks and cancel the rest when one succeeds, one would have to store all the child tasks separately and then iterate over them and cancel one by one. The Happy Eyeballs algorithm is one such use case (also used in AnyIO this way).
History
Date User Action Args
2022-02-17 00:18:04alex.gronholmsetrecipients: + alex.gronholm, gvanrossum, njs, jab, asvetlov, yselivanov, tinchester, iritkatriel, ajoino
2022-02-17 00:18:03alex.gronholmsetmessageid: <1645057083.88.0.499394918378.issue46771@roundup.psfhosted.org>
2022-02-17 00:18:03alex.gronholmlinkissue46771 messages
2022-02-17 00:18:03alex.gronholmcreate