-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: fix async iterator return when destroyed earlier #31508
Conversation
This reverts commit d15b8ea.
(I've discovered this because one of my modules broke because of this change) |
A test was missing for an async iterator created after the stream had emitted 'close'. This was regressed by nodejs#31314. See: nodejs#31314
34515ff
to
638ba66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
An alternative is to add a closeEmitted property and sort out ‘finished’. But that’s a bigger change and maybe semver-major.
Note, this might only be needed for 13.x if #31509 lands on master. |
Perhaps we should add it to CITGM? |
This comment has been minimized.
This comment has been minimized.
I don't think it adds much right now. I had it using the node core stream module because readable-stream had async iterators still experimental. As for the fix, I just switched to use readable-stream instead. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Landed in 64161f2...24e81d7 |
A test was missing for an async iterator created after the stream had emitted 'close'. This was regressed by #31314. See: #31314 PR-URL: #31508 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Previously finished(stream, cb) would not invoke the callback for streams that have already finished, ended or errored before being passed to finished(stream, cb). PR-URL: #31509 Refs: #31508 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
A test was missing for an async iterator created after the stream had emitted 'close'. This was regressed by #31314. See: #31314 PR-URL: #31508 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
A test was missing for an async iterator created after the stream had emitted 'close'. This was regressed by #31314. See: #31314 PR-URL: #31508 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Unfortunately, #31314 introduced a regression that made the loop not terminate:
I see that as more critical as an error not being forwarded. See #31314 (comment) for more details.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes