bpo-35046: do only one system call per line (logging.StreamHandler)#10042
Merged
Merged
bpo-35046: do only one system call per line (logging.StreamHandler)#10042
Conversation
When sys.stderr (or whatever other stream) is unbuffered, the current behavior results in two system calls and allows log records from different processes to concatenate on the same line in the output stream (followed by multiple newlines). This issue is new in Python 3.7, as stdout and stderr became "truly unbuffered" (cf. bpo-30404).
Member
|
Due to the recent GitHub outage and the resulting fallout, I didn't realise you'd created this PR, and so I went ahead and created my own (#10043). The only difference is that I added a comment referencing the issue, so that people could refer to it to see the detail of the reason (multiple syscalls leading to coalescing, and so forth). Would you add that comment? Then I can merge this and close my PR. Thanks! |
Contributor
|
Thanks @hashbrowncipher for the PR, and @vsajip for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Oct 23, 2018
…ythonGH-10042) (cherry picked from commit b7d6205) Co-authored-by: Josh Snyder <hashbrowncipher@users.noreply.github.com>
|
GH-10050 is a backport of this pull request to the 3.7 branch. |
|
Hi! The buildbot AMD64 FreeBSD CURRENT Shared 3.7 has failed when building commit d730719. You can take a look here: |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When sys.stderr (or whatever other stream) is unbuffered, this results in two system calls and allows log records from different processes to concatenate on the same line in the output stream (followed by multiple newlines). This issue is new in Python 3.7, as stdout and stderr became "truly unbuffered" (cf. #30404).
https://bugs.python.org/issue35046