mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: ignore stdout when dumpio isn't used (#7644)
When the browser child process has logging enabled and output on stdout isn't constantly processed, the brower process is about to freeze. To avoid such a situation at least the stdout pipe shouldn't be set by default but only if dumpio is enabled. Co-authored-by: Jan Scheffler <janscheffler@chromium.org>
This commit is contained in:
parent
b20c2bfa24
commit
5c592913a8
@ -64,10 +64,13 @@ export class BrowserRunner {
|
|||||||
start(options: LaunchOptions): void {
|
start(options: LaunchOptions): void {
|
||||||
const { handleSIGINT, handleSIGTERM, handleSIGHUP, dumpio, env, pipe } =
|
const { handleSIGINT, handleSIGTERM, handleSIGHUP, dumpio, env, pipe } =
|
||||||
options;
|
options;
|
||||||
let stdio: Array<'ignore' | 'pipe'> = ['pipe', 'pipe', 'pipe'];
|
let stdio: Array<'ignore' | 'pipe'>;
|
||||||
if (pipe) {
|
if (pipe) {
|
||||||
if (dumpio) stdio = ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'];
|
if (dumpio) stdio = ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'];
|
||||||
else stdio = ['ignore', 'ignore', 'ignore', 'pipe', 'pipe'];
|
else stdio = ['ignore', 'ignore', 'ignore', 'pipe', 'pipe'];
|
||||||
|
} else {
|
||||||
|
if (dumpio) stdio = ['pipe', 'pipe', 'pipe'];
|
||||||
|
else stdio = ['pipe', 'ignore', 'pipe'];
|
||||||
}
|
}
|
||||||
assert(!this.proc, 'This process has previously been started.');
|
assert(!this.proc, 'This process has previously been started.');
|
||||||
debugLauncher(
|
debugLauncher(
|
||||||
|
Loading…
Reference in New Issue
Block a user