Repository navigation
end is called twice when using pipeline #42866
Description
Activity
@nodejs/streams
- addedstreamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
on Apr 25, 2022 It's unnecessary that pipeline calls it twice but I wouldn't consider it a bug. Calling end the second time should be a noop.
It's probably easier to just implement
_final()instead unless there is a strong reason to be overridingend()?Reacted by Robert Nagy and Matteo CollinaReacted by KaKa- multiple calls to end() must be idempotent, so this is a bug in whoever is overriding end.
- pipeline should not call end more than once, but there
Reacted by KaKaIt's probably easier to just implement
_final()instead unless there is a strong reason to be overridingend()?This issue is extracted from
mongodband I do not know the reason behind to override both.write()and.end().
But, it is actually affecting a lot of people when they switch tonode@18.I already send this issue to their issue tracket. And ask them about the reason behind and will they accept change to use
._writeand._final.- addedhelp wantedIssues that need assistance from volunteers or PRs that need help to proceed.Issues that need assistance from volunteers or PRs that need help to proceed.
on Nov 4, 2022 Making sure pipeline only calls end once would be a nice to have fix.
Hello @ronag any pointers on where the end function is called during the pipeline function, have been trying to find a way to solve this issue
- added a commit that references this issue
on Jan 16, 2023 - added a commit that references this issue
on Jan 19, 2023 - added a commit that references this issue
on Jan 20, 2023 - added 2 commits that reference this issue
on Jan 26, 2023
Version
>= 17.3.0
Platform
Ubuntu 20.04
Subsystem
stream
What steps will reproduce the bug?
This behavior started since
17.3.0and it can also be reproduce on18.0.0How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
.endshould not call twice and behave similar topipe.What do you see instead?
.endbeing called twice when usingpipeline.Additional information
It is currently affecting
mongodbusage innode@18. I assume it is bug from core but not their side.If it is the expected behavior, I will try to fix it on
mongodbside.