-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[stdio] Bun hangs reading from stdin pipeline at >= 16384 Bytes (16KiB) #9041
Comments
This is fixed in the process PR #8456 |
It's still happening on 1.0.33, which I think that has that PR included |
Merged
When fixed we should remove the 1 line-ish workaround added in: #9580. |
Jarred-Sumner
added a commit
that referenced
this issue
Mar 29, 2024
* Workaround for #9041 * Fix crash with auto install * Fixup this test * Update 09041.test.ts --------- Co-authored-by: Jarred Sumner <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Bun is running?
1.0.27+c34bbb2e3
What platform is your computer?
Linux 6.7.4-arch1-1 x86_64 unknown
What steps can reproduce the bug?
Simple passthrough from stdin to stdout:
Independently of how you split it with the blocksize:
dd if=/dev/urandom bs=1 count=16383 | bun run <file>.ts > /dev/null
: works without any issuesdd if=/dev/urandom bs=1 count=16384 | bun run <file>.ts > /dev/null
: writes all the data to stdout, but the process hangs forever intead of stopping when stdin closesI believe it's stdin read, as the limit is always that, even applying compression to the algorithm.
What is the expected behavior?
Process should exit normally when stdin closes, just like it does with < 16KiB data, node behaves the same.
I noticed tho, that this slight modification seems to prevent the bug:
(TS types are broken tho)
What do you see instead?
The process hangs
Additional information
A side note, isn't the callback function on pipeline supposed to be optional?At least according to the types, excluding it doesn't cause any issue on my IDE but the code breaks:TypeError: The "streams[stream.length - 1]" property must be of type function. Received an instance of EventEmitter
Node behaves the same, but the types shouldn't be like that imo... it's nodejs's side anyways.
The text was updated successfully, but these errors were encountered: