Deno.run hangs when a child process returns more than 8200 characters and the stdout == piped. #12638
Replies: 3 comments
-
You have to read from stdout to avoid this. |
Beta Was this translation helpful? Give feedback.
-
I don't understand, the Deno example shows to wait for the status. https://deno.land/manual@v1.12.2/examples/subprocess Should I skip
|
Beta Was this translation helpful? Give feedback.
-
@CarlosOnline Stdout only has a limited maximum size that will buffered in the kernel. If your subprocess continually writes to the stdout pipe, it will eventually fill up. This will prevent the sub-process from exiting (because it is now blocked on writing its data to stdout, but the kernel won't let it). To prevent the pipe filling up, you need to read some bytes from your parent process. One way you can do this, is by running |
Beta Was this translation helpful? Give feedback.
-
Deno.run
hangs when a child process returns more than 8200 characters and the stdout == piped.Repro source code is in repository: https://github.com/CarlosOnline/deno-bugs.git
Repro:
https://github.com/CarlosOnline/deno-bugs.git
deno.exe run -A repro-run-hang.ts
Deno will hang between 8100 and 8200 characters.
Test code:
Repro code:
Beta Was this translation helpful? Give feedback.
All reactions