-
Notifications
You must be signed in to change notification settings - Fork 29.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
stream.pipeline doesn't wait for 'close' on error #51540
Comments
Hi, I am trying to get a bit more context here, do you expect the |
yes. from all that I've seen, I do think the intention of |
Thanks a lot for narrowing down the directions, if the fix is good are you happy for me to add you as a co-author on the PR? EDIT: Sorry, I think my fix was incorrect! |
IIRC the first error wins. The pipeline is "done" and all streams destroyed when the first error occurs. |
so if I understand correctly "done" here means all the streams have been destroyed but not guaranteed closed? |
Yes. |
about read not implemented: that was unintentional. wasn't I was using the closed property to check that the stream was destroyed, done being destroyed, specifically. now that I look more into the streams API, I see that you can configure streams not to emit a close event when you destroy them. that complicates things. for longer pipelines, it looks like the current logic would wait for about half of the streams to emit error before calling the callback, and that also feels weird. |
The pipeline should wait for close event to finish before calling the callback. The `finishCount` should not below 0 when calling finish function. Fixes: nodejs#51540
The pipeline should wait for close event to finish before calling the callback. The `finishCount` should not below 0 when calling finish function. Fixes: nodejs#51540
The pipeline should wait for close event to finish before calling the callback. The `finishCount` should not below 0 when calling finish function. Fixes: nodejs#51540 Co-authored-by: wh0 <[email protected]>
The pipeline should wait for close event to finish before calling the callback. The `finishCount` should not below 0 when calling finish function. Fixes: #51540 Co-authored-by: wh0 <[email protected]> PR-URL: #53462 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
The pipeline should wait for close event to finish before calling the callback. The `finishCount` should not below 0 when calling finish function. Fixes: #51540 Co-authored-by: wh0 <[email protected]> PR-URL: #53462 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
Version
v20.11.0
Platform
Linux cs-63018580108-ephemeral-4kum 6.1.58+ #1 SMP PREEMPT_DYNAMIC Sat Dec 30 15:31:26 UTC 2023 x86_64 GNU/Linux
Subsystem
internal/streams/pipeline
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
dst.closed=true
maybe? #32158 sounds like it should
What do you see instead?
Additional information
I notice that this
finishCount
countdown goes from 2 down to -3.The text was updated successfully, but these errors were encountered: