-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
concurrent.futures.wait() blocks forever when given duplicate Futures #64568
Comments
For a Future f which has already completed, 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 bpo-20367. |
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 bpo-20367. Suggestions welcome. |
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. |
Updated patch with change to Doc/library/concurrent.futures.rst. |
Reproduced on 3.11. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: