Repository navigation
gh-74028: concurrent.futures.Executor.map: avoid reference cycles when an exception is raised
#131701
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
Merged
+51
−4
Merged
gh-74028: concurrent.futures.Executor.map: avoid reference cycles when an exception is raised
#131701
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
3d481c8
`test_concurrent_futures.test_map_exception`: assert no reference cyc…
ebonnal f6f08a6
test there is no future in referrers
ebonnal a7a595d
switch to assertTrue(all(...))
ebonnal 984d228
add test msg
ebonnal 4cd4820
format msgs
ebonnal b7551c8
switch to assert list empty for a better assertion error message
ebonnal ec2b028
edit comment
ebonnal 171e083
assert there are no reference cycles at all
graingert 9710843
test that traceback frames should not contain any variables referring…
ebonnal 00e7aee
interpreter.WorkerContext.run: finally unassign exc_wrapper
ebonnal c62b24e
fix msg grammar
ebonnal a3046c1
fix access to exception
ebonnal 7b1021a
narrow test: traceback frames should not contain any exception
ebonnal e617e82
test_map_exception: only search for exception that captures itself in…
ebonnal f2e4dbe
concurrent.futures.process: avoid ref cycle in _sendback_result
ebonnal 1245a9a
concurrent.futures.process: avoid ref cycle in _process_worker
ebonnal e984592
format test msg
ebonnal d3dee34
refactor ZeroDivisionError assert
ebonnal fc2a351
Revert "concurrent.futures.process: avoid ref cycle in _process_worker"
ebonnal 2e29020
Revert "concurrent.futures.process: avoid ref cycle in _sendback_result"
ebonnal 51269d9
skip referrers test for free-threading build on win/linux
ebonnal ed0e87f
call gc.collect for free-threading on linux/windows
ebonnal b3f3f4a
Revert "call gc.collect for free-threading on linux/windows"
ebonnal e3e75ce
Revert "skip referrers test for free-threading build on win/linux"
ebonnal 70e22a1
more gc referrers
graingert 12abc0e
even more gc referrers
graingert cac4aac
delete a ref to work_item
graingert 66b98b4
delete reference to result_item before joining process
graingert 68fcecb
unpack ResultItem and WorkItem
graingert 0be8f49
fix typo
graingert 6c2406d
bit of a hack?
graingert 7037c4a
Revert investigations
ebonnal 0568262
pause before checking referrers
ebonnal cfeaa9b
add comment about the avoided ref cycle with exc_wrapper
ebonnal 346b4ea
format test
ebonnal 2a25b9a
make the self-captured exceptions check not rely on var name
ebonnal fd9b9bb
use traceback.walk_tb
ebonnal 682a719
comment the skipping of the current frame
ebonnal fb0c522
test_map_exception: improve readability
ebonnal e0a031d
Fix CI: break exception ref cycle in _MapResultIterator.__next__ (gh-…
ambv 6c8f6d6
test_map_exception: wait for transient referrers instead of sleep(1)
ambv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test looks fragile to me, +1 to remove test altogether, the fix is straightforward enough