Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: asyncio.gather/wait cancel children on first exception #76935

Closed
thehesiod mannequin opened this issue Feb 2, 2018 · 3 comments
Closed

feature request: asyncio.gather/wait cancel children on first exception #76935

thehesiod mannequin opened this issue Feb 2, 2018 · 3 comments
Labels
3.8 only security fixes topic-asyncio

Comments

@thehesiod
Copy link
Mannequin

thehesiod mannequin commented Feb 2, 2018

BPO 32754
Nosy @asvetlov, @1st1, @thehesiod, @iritkatriel
Superseder
  • bpo-46752: Introduce task groups to asyncio and change task cancellation semantics
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2022-03-30.21:21:54.459>
    created_at = <Date 2018-02-02.23:29:02.585>
    labels = ['3.8', 'expert-asyncio']
    title = 'feature request: asyncio.gather/wait cancel children on first exception'
    updated_at = <Date 2022-03-30.21:21:54.459>
    user = 'https://github.com/thehesiod'

    bugs.python.org fields:

    activity = <Date 2022-03-30.21:21:54.459>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-03-30.21:21:54.459>
    closer = 'iritkatriel'
    components = ['asyncio']
    creation = <Date 2018-02-02.23:29:02.585>
    creator = 'thehesiod'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32754
    keywords = []
    message_count = 3.0
    messages = ['311527', '311528', '415672']
    nosy_count = 4.0
    nosy_names = ['asvetlov', 'yselivanov', 'thehesiod', 'iritkatriel']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '46752'
    type = None
    url = 'https://bugs.python.org/issue32754'
    versions = ['Python 3.8']

    @thehesiod
    Copy link
    Mannequin Author

    thehesiod mannequin commented Feb 2, 2018

    currently gather/wait allow you to return on the first exception and leave the children executing.

    A very common use case that I have is of launching multiple tasks, and if any of them fail, then all should fail..otherwise the other tasks would continue running w/o anyone listening for the results. To accomplish this I wrote a method like the following: https://gist.github.com/thehesiod/524a1f005d0f3fb61a8952f272d8709e. I think it would be useful to many others as on optional perhaps a parameter to each of these methods.

    What do you guys think?

    @thehesiod thehesiod mannequin added 3.8 only security fixes topic-asyncio labels Feb 2, 2018
    @1st1
    Copy link
    Member

    1st1 commented Feb 2, 2018

    I think it's a good idea and I wanted to implement it by copying TaskGroups from curio in 3.7. But then I saw Trio's nurseries and I have a few ideas about slightly different design inspired by both curio and Trio :)

    I have some very WIP code that I plan to finish in a few weeks. I'll update this issue then.

    @iritkatriel
    Copy link
    Member

    Task groups are implemented under bpo-46752.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes topic-asyncio
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants