Issue 23859: asyncio: document behaviour of wait() cancellation (original) (raw)

Issue23859

Created on 2015-04-03 15:13 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 7217 merged Elvis.Pranskevichus,2018-05-29 20:03
PR 7227 merged miss-islington,2018-05-29 22:22
PR 7228 closed miss-islington,2018-05-29 22:23
PR 7230 merged Elvis.Pranskevichus,2018-05-29 22:52
Messages (5)
msg240001 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-04-03 15:13
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
msg318124 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-05-29 22:21
New changeset f9aeca2085464838f04bf13f816a1f861d43541f by Yury Selivanov (Elvis Pranskevichus) in branch 'master': bpo-23859: Document that asyncio.wait() does not cancel its futures (#7217) https://github.com/python/cpython/commit/f9aeca2085464838f04bf13f816a1f861d43541f
msg318136 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-29 22:48
> https://github.com/python/cpython/commit/f9aeca2085464838f04bf13f816a1f861d43541f " + when a timeout accurs. " typo: accurs => occurs
msg318145 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-05-30 01:26
New changeset f95269404c03bd769a3551cd851b51b8f89672df 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) (#7227) https://github.com/python/cpython/commit/f95269404c03bd769a3551cd851b51b8f89672df
msg318161 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-30 10:06
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.
History
Date User Action Args
2022-04-11 14:58:15 admin set github: 68047
2018-07-11 21:46:40 vstinner set status: open -> closedresolution: fixedstage: patch review -> resolved
2018-05-30 10:06:20 vstinner set messages: + versions: + Python 3.7, Python 3.8, - Python 3.4, Python 3.5
2018-05-30 01:26:24 yselivanov set messages: +
2018-05-29 22:52:37 Elvis.Pranskevichus set pull_requests: + <pull%5Frequest6862>
2018-05-29 22:48:21 vstinner set messages: +
2018-05-29 22:23:54 miss-islington set pull_requests: + <pull%5Frequest6860>
2018-05-29 22:22:56 miss-islington set pull_requests: + <pull%5Frequest6859>
2018-05-29 22:21:54 yselivanov set messages: +
2018-05-29 20:03:51 Elvis.Pranskevichus set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest6850>
2017-12-31 05:09:04 chris.jerdonek set versions: + Python 3.6
2017-12-31 05:07:55 chris.jerdonek set nosy: + chris.jerdonek
2015-04-03 15:13:17 vstinner create