Repository navigation
bpo-46210: Fix deadlock in print. #30310
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dc5d787
Fix deadlock in print.
notarealdeveloper 46d4ce6
Add Misc/NEWS.d entry.
notarealdeveloper 3409181
Only add _at_fork_reinit if fork is available.
notarealdeveloper 19f19b7
Use Py_RETURN_* in Modules/_io/bufferedio.c:buffered_at_fork_reinit
notarealdeveloper f5334b4
Fix up reference counting in Python/pystate.c:stdio_at_fork_reinit
notarealdeveloper 3858006
Formatting for PEP 7.
notarealdeveloper fb0bd16
Add _PySys_ReInitStdio to Python/sysmodule.c
notarealdeveloper 8c8d9c9
Call _PySys_ReInitStdio in PyOS_AfterFork_Child.
notarealdeveloper a14bf74
Avoid adding a new python method.
notarealdeveloper be40192
Add TestStdioAtForkReInit to test_thread.py
notarealdeveloper bf9b398
Move INCREF in _PyIO_buffered_at_fork_reinit
notarealdeveloper 5681a02
Remove unused variable in stdio_at_fork_reinit
notarealdeveloper 2054bfa
Correct buffer->lock reinit logic.
notarealdeveloper a8e4185
Merge remote-tracking branch 'upstream/main' into print
notarealdeveloper 56a405f
stream_at_fork_reinit now uses _Py_ID instead of _Py_Identifier.
notarealdeveloper 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
Add TestStdioAtForkReInit to test_thread.py
- Loading branch information
commit be40192b8ba06a8865c8704d44d6b108bb1eb669
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
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.
I dislike such function test, it's fragile and may break tomorrow. I would prefer to remove it.
If you want to keep it, you should:
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.
Can you clarify why you think it's fragile? It seems useful as a regression test. I do agree that it would be more stable in a separate script.
Uh oh!
There was an error while loading. Please reload this page.
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 is the only part I didn't change yet, b/c I wanted to check with you guys on the details.
@vstinner All the
at_fork_reinithandlers in the codebase have your name on them, so I'll trust your judgment here. (Though I'm also curious for the same reasons @JelleZijlstra mentioned).On the topic of the current test, you said "If you want to keep it, you should..."
What's the "else" condition for that sentence? I would prefer to do whatever you think makes the most sense. I don't have any strong opinions here, aside from a desire to have that one line in there that reinitializes the lock.
Test-wise, would you prefer (1) just moving the current test to a separate script? (2) removing the current test entirely? (3) a different test with certain properties that this one doesn't have?
I'm equally happy to do any of the above. :)