-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
An error is passed to writable.end(callback)
if _final
finishes later than .destroy()
#39356
Comments
@nodejs/streams |
This is wanted behavior, not a bug. The source of current behavior is that the stream resumes on the next tick and The key question to improve the user experience is if we should retain the |
We already do this. I think the best would be if end got the destroy error if it was called before destroy. |
Can we use a different error message in this case? The message I prefer that over reusing the |
I think the follow two should have the same error, otherwise it's confusing: s.end(callback);
s.destroy(new Error('oh no')); s.end(callback);
setTimeout(() => s.destroy(new Error('oh no')), 1e3); |
Version
v16.4.2
Platform
Linux solus 5.13.1-187.current #1 SMP PREEMPT Wed Jul 7 19:52:26 UTC 2021 x86_64 GNU/Linux
Subsystem
stream
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
What do you see instead?
Additional information
This could be the wanted behavior. But I don't think there's a way to recognize if
_final
actually timed out or not.The error in
.destroy(error)
is more important in my case, so the error saying that_final
timed out can be safely discarded - I'm not sure if it's possible though...The text was updated successfully, but these errors were encountered: