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

[REG 18.10.0->18.11.0] fs.promises.readFile from stdin is broken for slow input #52155

Closed
orgads opened this issue Mar 19, 2024 · 2 comments · Fixed by #52178
Closed

[REG 18.10.0->18.11.0] fs.promises.readFile from stdin is broken for slow input #52155

orgads opened this issue Mar 19, 2024 · 2 comments · Fixed by #52178

Comments

@orgads
Copy link
Contributor

orgads commented Mar 19, 2024

Version

18.11.0-18.19.0, 20.11.1

Platform

Linux

Subsystem

fs

What steps will reproduce the bug?

$ (echo -n '{'; sleep 1; echo -n '}') | docker run --rm -i node:18.10.0-alpine -e "const fs = require('fs/promises'); fs.readFile('/dev/stdin').then((data) => console.log(data.length))"
2
$ (echo -n '{'; sleep 1; echo -n '}') | docker run --rm -i node:18.11.0-alpine -e "const fs = require('fs/promises'); fs.readFile('/dev/stdin').then((data) => console.log(data.length))"
1

Reproducible also without docker:

$ (echo -n '{'; sleep 1; echo -n '}') | node -e "const fs = require('fs/promises'); fs.readFile('/dev/stdin').then((data) => console.log(data.length))"
1

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior? Why is that the expected behavior?

It should read stdin until EOF is reached.

What do you see instead?

It stops too early.

Additional information

This was broken by 67fb765 (and its other versions in the other branches).

@orgads
Copy link
Contributor Author

orgads commented Mar 19, 2024

@BridgeAR @danielleadams

@orgads
Copy link
Contributor Author

orgads commented Mar 19, 2024

nodejs-github-bot pushed a commit that referenced this issue May 11, 2024
targos pushed a commit that referenced this issue May 11, 2024
marco-ippolito pushed a commit that referenced this issue Jun 17, 2024
marco-ippolito pushed a commit that referenced this issue Jun 17, 2024
marco-ippolito pushed a commit that referenced this issue Jun 17, 2024
EliphazBouye pushed a commit to EliphazBouye/node that referenced this issue Jun 20, 2024
bmeck pushed a commit to bmeck/node that referenced this issue Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant