You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Undocumented breaking change in stream.pipeline? #33050
TLDR of the above issue is that sometimes the promisified version of pipeline never resolves, causing the program to hang or to exit with unfinished promises.
How often does it reproduce? Is there a required condition?
I have a limited knowledge of the Node.js Stream API, I haven't been able to isolate the bug in the issue I referenced above.
What is the expected behavior?
If there is a breaking change on Node.js 14, it should be documented, at least in the YAML metadata.
Ideally there would be a migration guide to workaround the breaking change.
Absolutely not, I just thought this's maybe an undocumented update issue like that one. Because the commit 1428a92 which author mentioned to only release in V14
The problem seems to be that the read stream never emits a 'close' event event though it probably should. Either need to fix the read stream or make finished even more strict in regards to when to assume it should wait for 'close'. Digging...
So the problem goes back to fd-slicer which implements its own destroy() function overriding the stream default autoDestroy behavior, thus it never emits 'close'.
@ronag could you also send a PR that list the semver-major changes to the history of pipeline/finished etc?
Sure, though I don't quite understand what that means in practice? In the documentation? Where and how? i.e. what is "the history of pipeline/finished etc"?
Activity
himself65 commentedon Apr 25, 2020
I think we have another undocumented semver-major change
like #32987
ronag commentedon Apr 25, 2020
@himself65 how is that related to streams?
ronag commentedon Apr 25, 2020
@aduh95 Do you think you could provide a full example on how to reproduce?
himself65 commentedon Apr 25, 2020
Absolutely not, I just thought this's maybe an undocumented update issue like that one. Because the commit 1428a92 which author mentioned to only release in V14
ronag commentedon Apr 25, 2020
FYI, I've moved the conversation to max-mapper/extract-zip#94 for now until I know how to reproduce the issue.
targos commentedon Apr 25, 2020
I had a similar issue with another zip extracting library. I can try to make a repro.
ronag commentedon Apr 25, 2020
Thanks. I'm struggling to make it fail. So far all my tries succeed.
ronag commentedon Apr 25, 2020
Ok, I managed to make it fail, pre #32967.
@aduh95 Can you confirm whether this is still a problem after #32967?
targos commentedon Apr 25, 2020
@ronag see https://github.com/targos/bug-zip-pipeline
Expected:
node test.jsshould print two lines (start/finished reading zip file) and the zip file should be fully extracted atresult/.Actual:
Edit:
If pipeline is replaced with manual pipe +
on('finish'), it works in all versions.aduh95 commentedon Apr 25, 2020
Yes, I can confirm it is still a problem. I am also able to reproduce using @targos repo:
ronag commentedon Apr 25, 2020
The problem seems to be that the read stream never emits a
'close'event event though it probably should. Either need to fix the read stream or makefinishedeven more strict in regards to when to assume it should wait for'close'. Digging...ronag commentedon Apr 25, 2020
So the problem goes back to
fd-slicerwhich implements its owndestroy()function overriding the stream defaultautoDestroybehavior, thus it never emits'close'.https://github.com/andrewrk/node-fd-slicer/blob/master/index.js#L102
At the moment I'm a little unsure how to fix this without basically to large degree disabling the
willEmitClosebehavior https://github.com/nodejs/node/blob/master/lib/internal/streams/end-of-stream.js#L75.ronag commentedon Apr 25, 2020
Neither
fd-slicernotyauzlseems to be maintained anymore 😞 so fixing them does not feel likely. thejoshwolfe/yauzl#115jasnell commentedon Apr 25, 2020
/cc @mafintosh @mcollina
stream: don't wait for close on legacy streams
ronag commentedon Apr 25, 2020
I think this should fix it, #33058
mcollina commentedon Apr 25, 2020
@ronag could you also send a PR that list the semver-major changes to the history of pipeline/finished etc?
ronag commentedon Apr 25, 2020
Sure, though I don't quite understand what that means in practice? In the documentation? Where and how? i.e. what is "the history of pipeline/finished etc"?#33065
ronag commentedon Apr 25, 2020
stream: don't wait for close on legacy streams
stream: don't wait for close on legacy streams
barisusakli commentedon Apr 29, 2020
Can anyone confirm if this issue is fixed? File uploads still fail with a simple app with connect-multiparty. expressjs/connect-multiparty#29
aduh95 commentedon Apr 29, 2020
I can confirm it is fixed on Node.js 14.1.0, I haven't tested the app you referenced though.
StephenLynx commentedon May 25, 2020
14.3 and multi-party is still broken tbh fam
exedealer commentedon Sep 28, 2020
here is my minimal bug reproduction https://github.com/exe-dealer/node-iss-33050
node v10 works fine, but node v14 is broken
stream: don't wait for close on legacy streams