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

asyncio: document behaviour of wait() cancellation #68047

Closed
vstinner opened this issue Apr 3, 2015 · 5 comments
Closed

asyncio: document behaviour of wait() cancellation #68047

vstinner opened this issue Apr 3, 2015 · 5 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes topic-asyncio

Comments

@vstinner
Copy link
Member

vstinner commented Apr 3, 2015

BPO 23859
Nosy @gvanrossum, @vstinner, @cjerdonek, @1st1
PRs
  • bpo-23859: Document that asyncio.wait() does not cancel its futures #7217
  • [3.7] bpo-23859: Document that asyncio.wait() does not cancel its futures (GH-7217) #7227
  • [3.6] bpo-23859: Document that asyncio.wait() does not cancel its futures (GH-7217) #7228
  • bpo-23859: Fix typo introduced in GH-7217 #7230
  • 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 2018-07-11.21:46:40.835>
    created_at = <Date 2015-04-03.15:13:17.440>
    labels = ['3.7', '3.8', 'expert-asyncio']
    title = 'asyncio: document behaviour of wait() cancellation'
    updated_at = <Date 2018-07-11.21:46:40.834>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2018-07-11.21:46:40.834>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-07-11.21:46:40.835>
    closer = 'vstinner'
    components = ['asyncio']
    creation = <Date 2015-04-03.15:13:17.440>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 23859
    keywords = ['patch']
    message_count = 5.0
    messages = ['240001', '318124', '318136', '318145', '318161']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'vstinner', 'chris.jerdonek', 'yselivanov']
    pr_nums = ['7217', '7227', '7228', '7230']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue23859'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    @vstinner
    Copy link
    Member Author

    vstinner commented Apr 3, 2015

    When wait(fs) is cancelled, futures of fs are not cancelled. This behaviour is not documented. It should be documented, and a warning should be added to the Cancellation section:
    https://docs.python.org/dev/library/asyncio-dev.html#cancellation

    See my message "Cancellation of asyncio.wait()":
    https://mail.google.com/mail/u/0/#label/Tulip/14b34f0a5d31114f

    @1st1
    Copy link
    Member

    1st1 commented May 29, 2018

    New changeset f9aeca2 by Yury Selivanov (Elvis Pranskevichus) in branch 'master':
    bpo-23859: Document that asyncio.wait() does not cancel its futures (bpo-7217)
    f9aeca2

    @vstinner
    Copy link
    Member Author

    f9aeca2

    " + when a timeout accurs. "

    typo: accurs => occurs

    @1st1
    Copy link
    Member

    1st1 commented May 30, 2018

    New changeset f952694 by Yury Selivanov (Miss Islington (bot)) in branch '3.7':
    [3.7] bpo-23859: Document that asyncio.wait() does not cancel its futures (GH-7217) (bpo-7227)
    f952694

    @vstinner
    Copy link
    Member Author

    Thank you Elvis for the documentation! Cancellation is one of the most complex part of asynchronous programming, and I don't think that asyncio documentation explains it properly. We may document the behaviour on cancellation for most task functions.

    https://docs.python.org/dev/library/asyncio-task.html#task-functions

    as_completed() behaviour on cancellation is not documented for example.

    The wait() documentation should be backported to 3.6 as well.

    @vstinner vstinner added 3.7 (EOL) end of life 3.8 only security fixes labels May 30, 2018
    @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.7 (EOL) end of life 3.8 only security fixes topic-asyncio
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants