René's URL Explorer Experiment


Title: stream: fix TransformStream race on cancel with pending write by marcopiraccini · Pull Request #62040 · nodejs/node · GitHub

Open Graph Title: stream: fix TransformStream race on cancel with pending write by marcopiraccini · Pull Request #62040 · nodejs/node

X Title: stream: fix TransformStream race on cancel with pending write by marcopiraccini · Pull Request #62040 · nodejs/node

Description: Fixes: #62036 Fix a race condition in TransformStream where a late writer.write() racing with reader.cancel() could throw an internal TypeError: controller[kState].transformAlgorithm is not a function The race occurs when cancel/abort/close clears the controller's algorithms via transformStreamDefaultControllerClearAlgorithms while a pending write reaches transformStreamDefaultControllerPerformTransform Added a guard in transformStreamDefaultControllerPerformTransform to check if transformAlgorithm is still callable before invoking it Race sequence reader.read() releases backpressure reader.cancel() triggers transformStreamDefaultSourceCancelAlgorithm, which calls transformStreamDefaultControllerClearAlgorithms — sets transformAlgorithm = undefined writer.write() enters transformStreamDefaultSinkWriteAlgorithm and calls transformStreamDefaultControllerPerformTransform performTransform tries to invoke transformAlgorithm() which is now undefined → TypeError Fix Guard transformStreamDefaultControllerPerformTransform so that if transformAlgorithm has been cleared (stream is shutting down), the write returns silently rather than throwing an internal error. The writable side's existing error handling surfaces the appropriate stream-level error to the caller. Spec note The WHATWG streams reference implementation has the same unguarded call in TransformStreamDefaultControllerPerformTransform. The race is latent in the spec but rarely surfaces in browsers due to WebIDL callback wrapping adding an extra promise tick that changes the interleaving order (see whatwg/streams#1296). Node.js hits it consistently because it lacks that extra indirection layer. Test plan New test test/parallel/test-whatwg-transformstream-cancel-write-race.js reproduces the race.

Open Graph Description: Fixes: #62036 Fix a race condition in TransformStream where a late writer.write() racing with reader.cancel() could throw an internal TypeError: controller[kState].transformAlgorithm is not a func...

X Description: Fixes: #62036 Fix a race condition in TransformStream where a late writer.write() racing with reader.cancel() could throw an internal TypeError: controller[kState].transformAlgorithm is not a func...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a63b641c-f81e-9678-f3b1-8b54e0490147
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDA06:1BB557:1171C2:176C82:6A4C2163
html-safe-nonce9865f45ebfa78708532536e7eb0baf7911de25bb0ee638f37ba7a96eff36258c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTA2OjFCQjU1NzoxMTcxQzI6MTc2QzgyOjZBNEMyMTYzIiwidmlzaXRvcl9pZCI6IjkxMTczMjA0MjI2OTc0NzY0NTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac52f4b9968c0633fbccaac16dade856f7cbd3d00c99f8b2ca8e9d7491741db51c
hovercard-subject-tagpull_request:3338788369
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/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/62040/files
twitter:imagehttps://avatars.githubusercontent.com/u/668050?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/668050?s=400&v=4
og:image:altFixes: #62036 Fix a race condition in TransformStream where a late writer.write() racing with reader.cancel() could throw an internal TypeError: controller[kState].transformAlgorithm is not a func...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None1b6b16d04026f131a36d57e3b01d0f4d26a51800edf48bf5ed0256e0ac905511
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef95fb36c72adc940ff991c03531114b2245658d0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/62040/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F62040%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
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%2F62040%2Ffiles
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%2Ffiles&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/62040/files
Reloadhttps://github.com/nodejs/node/pull/62040/files
Reloadhttps://github.com/nodejs/node/pull/62040/files
Please reload this pagehttps://github.com/nodejs/node/pull/62040/files
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/pull/62040/files
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode
Fork 36k https://github.com/login?return_to=%2Fnodejs%2Fnode
Star 118k https://github.com/login?return_to=%2Fnodejs%2Fnode
Code https://github.com/nodejs/node
Issues 1.4k https://github.com/nodejs/node/issues
Pull requests 968 https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality 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 and quality 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
nodejs-github-bothttps://github.com/nodejs-github-bot
nodejs:mainhttps://github.com/nodejs/node/tree/main
marcopiraccini:fix-transform-stream-racehttps://github.com/marcopiraccini/node/tree/fix-transform-stream-race
Conversation 13 https://github.com/nodejs/node/pull/62040
Commits 4 https://github.com/nodejs/node/pull/62040/commits
Checks 38 https://github.com/nodejs/node/pull/62040/checks
Files changed 2 https://github.com/nodejs/node/pull/62040/files
stream: fix TransformStream race on cancel with pending write https://github.com/nodejs/node/pull/62040/files#top
Show all changes 4 commits https://github.com/nodejs/node/pull/62040/files
2449435 stream: fix TransformStream race on cancel with pending write marcopiraccini Feb 28, 2026 https://github.com/nodejs/node/pull/62040/commits/2449435053b8eb4ab9d68ce76cddb1994cee74af
398e700 linting fixup marcopiraccini Feb 28, 2026 https://github.com/nodejs/node/pull/62040/commits/398e70014ef69e06e60870985b876c983f956d27
a84a506 test-fixup, use assert marcopiraccini Mar 3, 2026 https://github.com/nodejs/node/pull/62040/commits/a84a5066ceb6a6f8ca357f498275fb260040a10c
23c602d test if undefined instead of typeof. use node:test and assert marcopiraccini Mar 3, 2026 https://github.com/nodejs/node/pull/62040/commits/23c602d96d8d253410112fb74b2716266bfec250
Clear filters https://github.com/nodejs/node/pull/62040/files
Please reload this pagehttps://github.com/nodejs/node/pull/62040/files
Please reload this pagehttps://github.com/nodejs/node/pull/62040/files
transformstream.js https://github.com/nodejs/node/pull/62040/files#diff-45cad4ef90ad1549d1ed2ed3f3b7bc9782fece8a0daf45f04e4ec93241693c38
test-whatwg-transformstream-cancel-write-race.js https://github.com/nodejs/node/pull/62040/files#diff-15dccab5144a7c8ad20ffa270d1f411ab2bce7249473c69244a13a2ca8ecd601
lib/internal/webstreams/transformstream.jshttps://github.com/nodejs/node/pull/62040/files#diff-45cad4ef90ad1549d1ed2ed3f3b7bc9782fece8a0daf45f04e4ec93241693c38
View file https://github.com/marcopiraccini/node/blob/23c602d96d8d253410112fb74b2716266bfec250/lib/internal/webstreams/transformstream.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/62040/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/62040/files#diff-45cad4ef90ad1549d1ed2ed3f3b7bc9782fece8a0daf45f04e4ec93241693c38
https://github.com/nodejs/node/pull/62040/files#diff-45cad4ef90ad1549d1ed2ed3f3b7bc9782fece8a0daf45f04e4ec93241693c38
https://github.com/nodejs/node/pull/62040/files#diff-45cad4ef90ad1549d1ed2ed3f3b7bc9782fece8a0daf45f04e4ec93241693c38
https://github.com/nodejs/node/pull/62040/files#diff-45cad4ef90ad1549d1ed2ed3f3b7bc9782fece8a0daf45f04e4ec93241693c38
test/parallel/test-whatwg-transformstream-cancel-write-race.jshttps://github.com/nodejs/node/pull/62040/files#diff-15dccab5144a7c8ad20ffa270d1f411ab2bce7249473c69244a13a2ca8ecd601
View file https://github.com/marcopiraccini/node/blob/23c602d96d8d253410112fb74b2716266bfec250/test/parallel/test-whatwg-transformstream-cancel-write-race.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/62040/{{ revealButtonHref }}
Please reload this pagehttps://github.com/nodejs/node/pull/62040/files
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.