GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: keep async context of parked writes by mcollina · Pull Request #66907 · nodejs/node

Conversation

@mcollina

@mcollina mcollina commented Oct 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

A TransformStream write that parks on backpressure is resumed by the read that lifts the backpressure (transformStreamSetBackpressure(stream, false) enqueues writeContinuation). Since #65143/#65625 that meant transform() for the parked chunk, every write queued behind it (the continuation now attaches the writable controller's writeFulfilled/writeRejected), and finally flush() ran in the reader's async context instead of the writer's.

This captures the AsyncContextFrame when the write parks and restores it while the continuation runs, so the perform-transform call and the write reactions are registered in the same context the spec's [[backpressureChangePromise]] reaction had. The continuation still runs at the same microtask position.

Issue repro, before/after:

before: a:none b:none c:none d:none e:none flush:none
after:  a:writer b:writer c:writer d:writer e:writer flush:writer

The reverse direction was also broken (not reported in the issue): with the pipe started outside any store and the reader inside als.run('reader'), transform()/flush() saw reader. The new test covers both.

benchmark/webstreams/pipe-through.js (10 runs) shows no significant change (default +0.33% ±4.16%, transform -2.43% ±2.89%).

Backport note: v24.x and v26.x still have the async_hooks-based AsyncLocalStorage (--no-async-context-frame, removed on main in #63641), where the issue also reproduces. Backports need an extra fallback for that mode, e.g. reverting to promise-based parking when async hooks are enabled.

Fixes: #66906


AI generated, reviewed by me

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. web streams Issues and PRs related to the Web Streams API. labels Oct 21, 2026
@codecov

codecov Bot commented Oct 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.58%. Comparing base (14ed05f) to head (17dc6fa).
⚠️ Report is 43 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #66907   +/-   ##
=======================================
  Coverage   90.57%   90.58%           
=======================================
  Files         797      797           
  Lines      278502   278487   -15     
  Branches    53540    53530   -10     
=======================================
+ Hits       252257   252270   +13     
+ Misses      16587    16579    -8     
+ Partials     9658     9638   -20     
Files with missing lines Coverage Δ
lib/internal/webstreams/transformstream.js 98.80% <100.00%> (+0.01%) ⬆️

... and 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Oct 22, 2026
[v24.x] Revert parked transform write changes #66913
Closed
[v26.x] Revert parked transform write changes #66914
Closed
[v26.x] stream: keep async context of parked writes #66915
Closed
aduh95
aduh95 approved these changes Oct 22, 2026
View reviewed changes
@mcollina
stream: keep async context of parked writes
17dc6fa
A TransformStream write that parks on backpressure was resumed from
the read that lifted the backpressure, so transform(), the writes
queued behind it, and flush() ran in the reader's async context
instead of the writer's. Capture the async context frame when the
write parks and restore it while the continuation runs, matching the
context the spec's [[backpressureChangePromise]] reaction had.

Fixes: nodejs#66906

Signed-off-by: Matteo Collina <[email protected]>
@mcollina
mcollina force-pushed the webstreams-parked-write-async-context branch from f071601 to 17dc6fa Compare October 22, 2026 15:50
jasnell
jasnell approved these changes Oct 22, 2026
View reviewed changes
@aduh95 aduh95 added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. author ready PRs with CI started, the required approvals, and no outstanding review comments. lts-watch-v24.x PRs that may need to be released in v24.x labels Oct 23, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 23, 2026
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@nodejs-github-bot

nodejs-github-bot commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78621/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina mcollina added the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 25, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 60e6c84 into nodejs:main Oct 25, 2026
76 of 78 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Landed in 60e6c84

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 25, 2026
@aduh95 aduh95 mentioned this pull request Oct 27, 2026
v24.22.2 proposal #67040
Merged
@aduh95 aduh95 removed the lts-watch-v24.x PRs that may need to be released in v24.x label Oct 27, 2026
@robobun robobun mentioned this pull request Oct 27, 2026
streams: run every callback of a direct source in the stream's AsyncLocalStorage context oven-sh/bun#41561
Open
@mcollina
mcollina deleted the webstreams-parked-write-async-context branch October 27, 2026 08:51
@aduh95 aduh95 mentioned this pull request Oct 27, 2026
2026-10-28, Version 27.0.0-alpha.0.0.0 (Alpha) #67062
Merged
aduh95 pushed a commit that referenced this pull request Oct 28, 2026
@mcollina @aduh95
stream: keep async context of parked writes
e65b707
A TransformStream write that parks on backpressure was resumed from
the read that lifted the backpressure, so transform(), the writes
queued behind it, and flush() ran in the reader's async context
instead of the writer's. Capture the async context frame when the
write parks and restore it while the continuation runs, matching the
context the spec's [[backpressureChangePromise]] reaction had.

Fixes: #66906

Signed-off-by: Matteo Collina <[email protected]>
PR-URL: #66907
Backport-PR-URL: #66915
Fixes: #66906
Refs: #66906
Refs: #66907
Reviewed-By: James M Snell <[email protected]>
panva pushed a commit to panva/node that referenced this pull request Oct 28, 2026
@mcollina @aduh95
stream: keep async context of parked writes
17ec999
A TransformStream write that parks on backpressure was resumed from
the read that lifted the backpressure, so transform(), the writes
queued behind it, and flush() ran in the reader's async context
instead of the writer's. Capture the async context frame when the
write parks and restore it while the continuation runs, matching the
context the spec's [[backpressureChangePromise]] reaction had.

Fixes: nodejs#66906

Signed-off-by: Matteo Collina <[email protected]>
PR-URL: nodejs#66907
Backport-PR-URL: nodejs#66915
Fixes: nodejs#66906
Refs: nodejs#66906
Refs: nodejs#66907
Reviewed-By: James M Snell <[email protected]>
This was referenced Oct 28, 2026
Stack updates: 5 to look at Gooseankles/cirrus-watch#9
Closed
chore(deps): update node.js to v24.22.2 tailor-platform/sdk#2857
Closed
@inoway46 inoway46 mentioned this pull request Oct 29, 2026
stream: keep writer async context for parked transform writes #66908
Closed
markharding pushed a commit to futo-org/Harbor that referenced this pull request Nov 3, 2026
harbor-bot @markharding
Update Node.js to v24.22.2 (#2149)
e6edbf5
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [node](https://nodejs.org) ([source](https://github.com/nodejs/node)) | patch | `24.22.1` → `24.22.2` |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/2097) for more information.

---

### Release Notes

<details>
<summary>nodejs/node (node)</summary>

### [`v24.22.2`](https://github.com/nodejs/node/releases/tag/v24.22.2): 2026-10-28, Version 24.22.2 'Krypton' (LTS), @&#8203;aduh95

[Compare Source](nodejs/node@v24.22.1...v24.22.2)

##### Commits

- \[[`f8bdcd54ed`](nodejs/node@f8bdcd54ed)] - **deps**: V8: backport [`786c1c2`](nodejs/node@786c1c2d88d4) (Eliau Elkouby) [#&#8203;66249](nodejs/node#66249)
- \[[`3b93fd6b2b`](nodejs/node@3b93fd6b2b)] - **deps**: V8: backport [`1a00890`](nodejs/node@1a0089053443) (Jakob Linke) [#&#8203;65764](nodejs/node#65764)
- \[[`5aaf62faaa`](nodejs/node@5aaf62faaa)] - **deps**: V8: backport [`c9c0abf`](nodejs/node@c9c0abfa51f0) (Jakob Linke) [#&#8203;65764](nodejs/node#65764)
- \[[`3b8eb1a920`](nodejs/node@3b8eb1a920)] - **deps**: V8: backport [`ebd1578`](nodejs/node@ebd15783b7ba) (Marja Hölttä) [#&#8203;65764](nodejs/node#65764)
- \[[`ab70b5d681`](nodejs/node@ab70b5d681)] - **deps**: V8: cherry-pick [`853553f`](nodejs/node@853553fe755c) (Victor Gomes) [#&#8203;66241](nodejs/node#66241)
- \[[`17ec999f24`](nodejs/node@17ec999f24)] - **stream**: keep async context of parked writes (Matteo Collina) [#&#8203;66907](nodejs/node#66907)

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 9am on tuesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xODguMiIsInVwZGF0ZWRJblZlciI6IjQ0LjIwNi4yIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://code.futo.org/harbor/harbor/pulls/2149
Reviewed-by: Thomas de Zeeuw <[email protected]>
@claude claude Bot mentioned this pull request Nov 5, 2026
Update dockerfile dependencies PeerDB-io/peerdb#5006
Merged
1 task
@shrinedogg shrinedogg mentioned this pull request Nov 9, 2026
chore(deps): update dependency nodejs/node to v24.22.2 polarsquad/krops#763
Merged
1 task
aduh95 pushed a commit that referenced this pull request Nov 11, 2026
@mcollina @aduh95
stream: keep async context of parked writes
a5bbc7b
A TransformStream write that parks on backpressure was resumed from
the read that lifted the backpressure, so transform(), the writes
queued behind it, and flush() ran in the reader's async context
instead of the writer's. Capture the async context frame when the
write parks and restore it while the continuation runs, matching the
context the spec's [[backpressureChangePromise]] reaction had.

Fixes: #66906

Signed-off-by: Matteo Collina <[email protected]>
PR-URL: #66907
Backport-PR-URL: #66915
Fixes: #66906
Refs: #66906
Refs: #66907
Reviewed-By: James M Snell <[email protected]>
@grey275 grey275 mentioned this pull request Nov 16, 2026
fix(deps): node 24.22.2 in the nix dev shell, the image and .tool-versions Tactrigsds/squad-layer-manager#671
Merged
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
2026-11-30, Version 26.14.0 'Lithium' (LTS) #67664
Open
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@mcollina @gabylb
stream: keep async context of parked writes
976895c
A TransformStream write that parks on backpressure was resumed from
the read that lifted the backpressure, so transform(), the writes
queued behind it, and flush() ran in the reader's async context
instead of the writer's. Capture the async context frame when the
write parks and restore it while the continuation runs, matching the
context the spec's [[backpressureChangePromise]] reaction had.

Fixes: nodejs#66906

Signed-off-by: Matteo Collina <[email protected]>
PR-URL: nodejs#66907
Fixes: nodejs#66906
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@aduh95 aduh95 aduh95 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. needs-ci PRs that need a full CI run. web streams Issues and PRs related to the Web Streams API.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

webstreams: transform() loses AsyncLocalStorage context after a parked write (regression in v24.22.0)

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@mcollina @nodejs-github-bot @jasnell @aduh95
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.