René's URL Explorer Experiment


Title: stream: fix _final and 'prefinish' timing by ronag · Pull Request #32780 · nodejs/node · GitHub

Open Graph Title: stream: fix _final and 'prefinish' timing by ronag · Pull Request #32780 · nodejs/node

X Title: stream: fix _final and 'prefinish' timing by ronag · Pull Request #32780 · nodejs/node

Description: This PR fixes a few different things: The timing of 'prefinish' depends on whether or not _final is defined. In one case the event is emitted synchronously with end() and otherwise asynchronously. _final is currently unecessarily called asynchronously which forces implementors to use 'prefinish' as a hack to emulate synchronous behaviour. Furthermore, this hack is subtly broken due to the above issue. The stream should not finish if errored or destroyed synchronously during the prefinish stage. Refs: #31401 Refs: #32763 (comment) Checklist make -j4 test (UNIX), or vcbuild test (Windows) passes tests and/or benchmarks are included documentation is changed or added commit message follows commit guidelines

Open Graph Description: This PR fixes a few different things: The timing of 'prefinish' depends on whether or not _final is defined. In one case the event is emitted synchronously with end() and otherwise asynchro...

X Description: This PR fixes a few different things: The timing of 'prefinish' depends on whether or not _final is defined. In one case the event is emitted synchronously with end() and otherwise ...

Opengraph URL: https://github.com/nodejs/node/pull/32780

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:fd46e15d-98a0-fbd0-f10b-d3b4f0be6930
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCD2E:3A82ED:A8DB91:E9A82C:69975FC7
html-safe-nonce58f39e1c8a21b73e31b73705b70919c11ae16ae89c8ac62933eca386acebb472
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDJFOjNBODJFRDpBOERCOTE6RTlBODJDOjY5OTc1RkM3IiwidmlzaXRvcl9pZCI6IjcxMjIzNjkxMTUxMTQxMzU0OTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd75c832e25f748cab505c51b8bd6fbbd05560acf3c74842fb9cf17a3afda511b
hovercard-subject-tagpull_request:402176579
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
twitter:imagehttps://avatars.githubusercontent.com/u/3065230?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/3065230?s=400&v=4
og:image:altThis PR fixes a few different things: The timing of 'prefinish' depends on whether or not _final is defined. In one case the event is emitted synchronously with end() and otherwise asynchro...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonec2f6b9675e9141deef3eda21e5cb896d461bd4d25aeaeeba804502ef0e8d01f2
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb05d982477497a3bcc7dafa43a01757894c08f44
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F32780%2Fcommits%2F571eb8893763991da627834bf7260f702ab60edf
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F32780%2Fcommits%2F571eb8893763991da627834bf7260f702ab60edf
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fcommits&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
Reloadhttps://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
Reloadhttps://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode
Fork 34.8k https://github.com/login?return_to=%2Fnodejs%2Fnode
Star 116k https://github.com/login?return_to=%2Fnodejs%2Fnode
Code https://github.com/nodejs/node
Issues 1.8k https://github.com/nodejs/node/issues
Pull requests 713 https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects 3 https://github.com/nodejs/node/projects
Security 0 https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Code https://github.com/nodejs/node
Issues https://github.com/nodejs/node/issues
Pull requests https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
ronaghttps://github.com/ronag
nodejs:masterhttps://github.com/nodejs/node/tree/master
nxtedition:stream-finishhttps://github.com/nxtedition/node/tree/stream-finish
Conversation 65 https://github.com/nodejs/node/pull/32780
Commits 3 https://github.com/nodejs/node/pull/32780/commits
Checks 0 https://github.com/nodejs/node/pull/32780/checks
Files changed https://github.com/nodejs/node/pull/32780/files
Please reload this pagehttps://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
stream: fix _final and 'prefinish' timing https://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf#top
Show all changes 3 commits https://github.com/nodejs/node/pull/32780/files
be9f726 stream: fix _final and 'prefinish' timing ronag Apr 11, 2020 https://github.com/nodejs/node/pull/32780/commits/be9f7264c9fd643e8378449616b0abc4e6b45099
469766e fixup: comments ronag Apr 15, 2020 https://github.com/nodejs/node/pull/32780/commits/469766e1b9f69c6f0cf6cc73d925c29cdce4394e
571eb88 fixup: missing needFinish ronag Apr 15, 2020 https://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
Clear filters https://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
Please reload this pagehttps://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
Please reload this pagehttps://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
Prev https://github.com/nodejs/node/pull/32780/commits/469766e1b9f69c6f0cf6cc73d925c29cdce4394e
Please reload this pagehttps://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf
https://github.com/ronag
ronaghttps://github.com/nodejs/node/commits?author=ronag
lib/_stream_writable.jshttps://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf#diff-a7fdfe149712099064db4e7b80a1b39e28515b4efb3fab2f4b9499ce3b7c51c3
View file https://github.com/nxtedition/node/blob/571eb8893763991da627834bf7260f702ab60edf/lib/_stream_writable.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/32780/commits/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf#diff-a7fdfe149712099064db4e7b80a1b39e28515b4efb3fab2f4b9499ce3b7c51c3
https://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf#diff-a7fdfe149712099064db4e7b80a1b39e28515b4efb3fab2f4b9499ce3b7c51c3
https://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf#diff-a7fdfe149712099064db4e7b80a1b39e28515b4efb3fab2f4b9499ce3b7c51c3
https://github.com/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf#diff-a7fdfe149712099064db4e7b80a1b39e28515b4efb3fab2f4b9499ce3b7c51c3
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.