Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
stream: error state timing#30851
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: error state timing #30851
Uh oh!
There was an error while loading. Please reload this page.
Conversation
ronag commented Dec 8, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
757667b to 8cda582Compare This comment has been minimized.
This comment has been minimized.
b365b0e to dc03c53CompareClean up end simplify errored state. - errorEmitted should be set in the same tick as 'error' is emitted. - errored should be set as soon as an error occurs. - errored should exist on Readable as well. - refactor destroy logic and make it easier to follow.
dc03c53 to 20a2a29Compareronag commented Dec 8, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
since this slightly changes timing it should probably be semver-major, even if it only applies to "internal" state. |
lpinca commented Dec 9, 2019
@nodejs/streams |
mcollina left a comment
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.
Should we change the docs on any of this at all?
LGTM
ronag commented Dec 9, 2019
I don't think so. Did you have anything specific in mind? This mostly affects internal details and is how I think it is expected to work. |
mcollina commented Dec 9, 2019
No, not really. |
nodejs-github-bot commented Dec 14, 2019 • edited by addaleax
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by addaleax
Uh oh!
There was an error while loading. Please reload this page.
ronag commented Dec 14, 2019
This need another TSC approval. Maybe @addaleax? |
nodejs-github-bot commented Dec 14, 2019
nodejs-github-bot commented Dec 15, 2019 • edited by BridgeAR
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by BridgeAR
Uh oh!
There was an error while loading. Please reload this page.
Clean up end simplify errored state. - errorEmitted should be set in the same tick as 'error' is emitted. - errored should be set as soon as an error occurs. - errored should exist on Readable as well. - refactor destroy logic and make it easier to follow. PR-URL: #30851 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
BridgeAR commented Dec 15, 2019
Landed in 67ed526 🎉 |
Fix, clean up and simplify errored state.
errorEmittedshould be set in the same tick as'error'is emitted.erroredwas not set (if receiving error through_destroy)erroredshould exist onReadableas well.errorEmittedis currently set in a tick before'error'is actually emitted which is a bit confusing (and inconsistent with other event has been emitted state, e.g.endEmitted). If we need to know the synchronous error state we should useerrored.There was a potential race in
console(at least in theory). We want to swallow an error if it's about to be emitted. However, sinceerrorEmittedwas set totruein the tick before the error is actually emitted, the "swallow error" logic might not be applied if the timing is unfortunate.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes