stream.finished throws ERR_STREAM_PREMATURE_CLOSE when it shouldn't #45281
Copy link
Copy link
Closed
Labels
streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
Description
Activity
- addedstreamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
on Nov 2, 2022 cc: @ronag
- added a commit that references this issue
on Nov 3, 2022 - added a commit that references this issue
on Nov 20, 2022 - added a commit that references this issue
on Nov 21, 2022
Metadata
Metadata
Assignees
Labels
streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
Version
17.x, 18.x, 19.x
Platform
Darwin watson.localdomain 21.6.0 Darwin Kernel Version 21.6.0: Thu Sep 29 20:13:56 PDT 2022; root:xnu-8020.240.7~1/RELEASE_ARM64_T6000 arm64
Subsystem
stream
What steps will reproduce the bug?
On Node.js 17 and newer, the program below will call the
finishedcallback with anERR_STREAM_PREMATURE_CLOSEerror.How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
I'm not sure. For me it's unexpected and I'm not sure how to use
finishedin a scenario like this without getting this error.What do you see instead?
I would expect the
finishedcallback to be called without an error.Additional information
As mentioned above, I'm not 100% if this is a bug or not. If it's not a bug, then the behaviour is at least unexpected and
finishedprobably needs better documentation.