Skip to content
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

bpo-35046: do only one system call per line (logging.StreamHandler) #10042

Merged
merged 2 commits into from Oct 23, 2018

Conversation

hashbrowncipher
Copy link
Contributor

@hashbrowncipher hashbrowncipher commented Oct 22, 2018

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

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).
@vsajip
Copy link
Member

vsajip commented Oct 23, 2018

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!

@vsajip vsajip merged commit b7d6205 into python:master Oct 23, 2018
@miss-islington
Copy link
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>
@bedevere-bot
Copy link

GH-10050 is a backport of this pull request to the 3.7 branch.

@bedevere-bot
Copy link

Hi! The buildbot AMD64 FreeBSD CURRENT Shared 3.7 has failed when building commit d730719.

You can take a look here:

https://buildbot.python.org/all/#builders/173/builds/57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants