8000 gh-131466: `concurrent.futures.Executor.map`: avoid temporarily exceeding `buffersize` while collecting the next result by ebonnal · Pull Request #131467 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-131466: concurrent.futures.Executor.map: avoid temporarily exceeding buffersize while collecting the next result #131467

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
move the ref cycle break into the finally block
  • Loading branch information
ebonnal committed Mar 25, 2025
commit d50dabd8ddf1d87d698053bd59e1f7da4b19a29c
9 changes: 5 additions & 4 deletions Lib/concurrent/futures/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,11 +633,12 @@ def result_iterator():

# yield the awaited result
yield fs.pop()._result
except:
# break the reference cycle with fs[-1]._exception's traceback
fs.pop().cancel()
raise

finally:
# break the reference cycle with fs[-1]._exception's traceback
if fs:
fs.pop().cancel()

for future in fs:
future.cancel()

Expand Down
Loading
0