Issue 20369: concurrent.futures.wait() blocks forever when given duplicate Futures (original) (raw)

Issue20369

Created on 2014-01-23 15:33 by glangford, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_dupfuture_wait.py glangford,2014-01-23 15:33
issue20369.patch glangford,2014-01-23 19:20 review
issue20369.patch glangford,2014-01-25 21:46 review
issue20369.patch glangford,2014-01-27 17:49 review
Pull Requests
URL Status Linked Edit
PR 30168 merged kumaraditya,2021-12-17 12:02
PR 30400 merged miss-islington,2022-01-04 13:36
PR 30401 merged miss-islington,2022-01-04 13:36
Messages (7)
msg208960 - (view) Author: Glenn Langford (glangford) * Date: 2014-01-23 15:33
For a Future f which has already completed, wait( [f,f], return_when=ALL_COMPLETED ) blocks forever. This is because the test in wait(): if len(done) == len(fs) is comparing the length of a set to the length of a list. If f has not completed, wait( [f,f] ) will yield f once. The behaviour should be consistent with as_completed() - see issue #20367.
msg208979 - (view) Author: Glenn Langford (glangford) * Date: 2014-01-23 19:20
Proposed patch...please treat with an appropriate level of suspicion since this is my first patch submission. :-) A corresponding change will be made to as_completed() for #20367. Suggestions welcome.
msg209241 - (view) Author: Glenn Langford (glangford) * Date: 2014-01-25 21:46
Updated patch with a test case, and added a minor note to the docstring to clarify behaviour. The use of sleep() in the test is not great, but it is the most obvious way to test and it is consistent with the approach used in other concurrent test cases.
msg209454 - (view) Author: Glenn Langford (glangford) * Date: 2014-01-27 17:49
Updated patch with change to Doc/library/concurrent.futures.rst.
msg408390 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-12-12 15:21
Reproduced on 3.11.
msg409676 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2022-01-04 13:36
New changeset 7d7817cf0f826e566d8370a0e974bbfed6611d91 by Kumar Aditya in branch 'main': bpo-20369: concurrent.futures.wait() now deduplicates futures given a… (GH-30168) https://github.com/python/cpython/commit/7d7817cf0f826e566d8370a0e974bbfed6611d91
msg409681 - (view) Author: miss-islington (miss-islington) Date: 2022-01-04 14:27
New changeset 9a9061d1ca7e28dc2b7e326153e933872c7cd452 by Miss Islington (bot) in branch '3.9': bpo-20369: concurrent.futures.wait() now deduplicates futures given a… (GH-30168) https://github.com/python/cpython/commit/9a9061d1ca7e28dc2b7e326153e933872c7cd452
msg409682 - (view) Author: miss-islington (miss-islington) Date: 2022-01-04 14:27
New changeset ba124672d7bf490bea2930a3e8371823db5d4cae by Miss Islington (bot) in branch '3.10': bpo-20369: concurrent.futures.wait() now deduplicates futures given a… (GH-30168) https://github.com/python/cpython/commit/ba124672d7bf490bea2930a3e8371823db5d4cae
History
Date User Action Args
2022-04-11 14:57:57 admin set github: 64568
2022-01-04 14:35:22 AlexWaygood set status: open -> closedresolution: fixedstage: patch review -> resolved
2022-01-04 14:27:41 miss-islington set messages: +
2022-01-04 14:27:40 miss-islington set messages: +
2022-01-04 13:36:45 pablogsal set nosy: + pablogsalmessages: +
2022-01-04 13:36:33 miss-islington set pull_requests: + <pull%5Frequest28609>
2022-01-04 13:36:28 miss-islington set nosy: + miss-islingtonpull_requests: + <pull%5Frequest28608>
2021-12-22 13:19:04 mark.dickinson set nosy: - mark.dickinson
2021-12-17 12:02:48 kumaraditya set keywords: + patchnosy: + kumaradityapull_requests: + <pull%5Frequest28385>stage: patch review
2021-12-12 15:24:35 iritkatriel set keywords: + easy, - patch
2021-12-12 15:21:38 iritkatriel set versions: + Python 3.9, Python 3.10, Python 3.11, - Python 3.3, Python 3.4nosy: + iritkatrielmessages: + components: + Library (Lib)type: behavior
2014-07-18 16:45:55 glangford set nosy: - glangford
2014-01-27 17:49:41 glangford set files: + issue20369.patchmessages: +
2014-01-25 21:46:30 glangford set files: + issue20369.patchmessages: +
2014-01-23 19:20:56 glangford set files: + issue20369.patchkeywords: + patchmessages: +
2014-01-23 15:33:51 glangford create