Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fbc9ef8

Browse filesBrowse files
bnoordhuisevanlucas
authored andcommitted
src: disable stdio buffering
Disable stdio buffering, it interacts poorly with printf() calls from elsewhere in the program (e.g., any logging from V8.) Unbreaks among other things the `--trace_debug_json` switch. Undoes commit 0966ab9 ("src: force line buffering for stderr"), which in retrospect is not a proper fix. Turning on line buffering fixed a flaky test on SmartOS but the test wasn't failing on other platforms, where stderr wasn't line-buffered either. Mark the test flaky again, it failed once in a run of 333 tries on the smartos-64 buildbot. Disabling buffering should be safe even when mixed with non-blocking stdio I/O because libuv goes to great lengths to reopen the tty file descriptors and falls back to blocking I/O when that fails. PR-URL: #7610 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent df697c4 commit fbc9ef8
Copy full SHA for fbc9ef8

File tree

Expand file treeCollapse file tree

2 files changed

+5
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-1
lines changed
Open diff view settings
Collapse file

‎src/node_main.cc‎

Copy file name to clipboardExpand all lines: src/node_main.cc
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ int wmain(int argc, wchar_t *wargv[]) {
5050
#else
5151
// UNIX
5252
int main(int argc, char *argv[]) {
53-
setvbuf(stderr, NULL, _IOLBF, 1024);
53+
// Disable stdio buffering, it interacts poorly with printf()
54+
// calls elsewhere in the program (e.g., any logging from V8.)
55+
setvbuf(stdout, nullptr, _IONBF, 0);
56+
setvbuf(stderr, nullptr, _IONBF, 0);
5457
return node::Start(argc, argv);
5558
}
5659
#endif
Collapse file

‎test/parallel/parallel.status‎

Copy file name to clipboardExpand all lines: test/parallel/parallel.status
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ test-tls-connect-address-family : PASS,FLAKY
2222
[$system==macos]
2323

2424
[$system==solaris] # Also applies to SmartOS
25+
test-debug-signal-cluster : PASS,FLAKY
2526

2627
[$system==freebsd]
2728

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.