Skip to content

[Fizz] Fix aborts during resumed rendering#36584

Merged
gnoff merged 1 commit into
facebook:mainfrom
gnoff:jstory/resume-abort
May 31, 2026
Merged

[Fizz] Fix aborts during resumed rendering#36584
gnoff merged 1 commit into
facebook:mainfrom
gnoff:jstory/resume-abort

Conversation

@gnoff
Copy link
Copy Markdown
Collaborator

@gnoff gnoff commented May 31, 2026

Stacked on #36583

Fizz previously identified a task that was rendering during an abort by marking its blocked Segment as RENDERING. This does not work for resumed replay tasks because they do not have a Segment, so an abort during replay could eagerly abort the task before it unwound and then report the internal null throw instead of the abort reason.

Track the task currently executing on the Request so aborting can leave the in-flight task to unwind through its normal error path for both render and replay tasks. Since this replaces the only purpose of the Segment RENDERING status, remove that status and its associated bookkeeping.

When resumed work unwinds after aborting, use the request's abort reason in the replay catch paths so aborting while replaying a prerendered tree or while rendering a resumed segment reports the meaningful abort reason instead of the internal control-flow value.

@gnoff gnoff requested a review from eps1lon May 31, 2026 17:40
@meta-cla meta-cla Bot added the CLA Signed label May 31, 2026
@gnoff gnoff requested a review from unstubbable May 31, 2026 17:41
@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label May 31, 2026
@react-sizebot
Copy link
Copy Markdown

react-sizebot commented May 31, 2026

Comparing: ddcb58f...019b9dd

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 614.26 kB 614.26 kB = 108.57 kB 108.57 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 680.19 kB 680.19 kB = 119.51 kB 119.51 kB
facebook-www/ReactDOM-prod.classic.js = 700.61 kB 700.61 kB = 123.09 kB 123.09 kB
facebook-www/ReactDOM-prod.modern.js = 690.93 kB 690.93 kB = 121.48 kB 121.48 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-server/cjs/react-server.production.js +0.45% 150.52 kB 151.19 kB +0.35% 26.68 kB 26.77 kB
oss-stable-semver/react-server/cjs/react-server.production.js +0.42% 147.04 kB 147.65 kB +0.39% 25.88 kB 25.98 kB
oss-stable/react-server/cjs/react-server.production.js +0.42% 147.04 kB 147.65 kB +0.39% 25.88 kB 25.98 kB
oss-stable-semver/react-server/cjs/react-server.development.js +0.37% 211.80 kB 212.59 kB +0.19% 37.45 kB 37.52 kB
oss-stable/react-server/cjs/react-server.development.js +0.37% 211.80 kB 212.59 kB +0.19% 37.45 kB 37.52 kB
oss-experimental/react-server/cjs/react-server.development.js +0.36% 216.59 kB 217.38 kB +0.19% 38.37 kB 38.44 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.js +0.26% 260.67 kB 261.34 kB +0.20% 46.64 kB 46.74 kB
oss-experimental/react-markup/cjs/react-markup.production.js +0.25% 248.01 kB 248.64 kB +0.19% 46.00 kB 46.09 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.js +0.25% 266.45 kB 267.12 kB +0.21% 48.86 kB 48.96 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.js +0.24% 250.88 kB 251.50 kB +0.20% 45.21 kB 45.30 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.js +0.24% 250.91 kB 251.52 kB +0.20% 45.23 kB 45.33 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.js +0.24% 256.09 kB 256.70 kB +0.21% 47.19 kB 47.29 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.js +0.24% 256.11 kB 256.73 kB +0.21% 47.21 kB 47.31 kB
facebook-www/ReactDOMServer-prod.modern.js +0.24% 257.46 kB 258.07 kB +0.19% 46.00 kB 46.09 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js +0.24% 267.68 kB 268.31 kB +0.23% 48.97 kB 49.08 kB
facebook-www/ReactDOMServer-prod.classic.js +0.24% 259.79 kB 260.41 kB +0.18% 46.35 kB 46.44 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.js +0.23% 289.93 kB 290.60 kB +0.22% 51.19 kB 51.30 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.js +0.23% 290.82 kB 291.48 kB +0.20% 51.11 kB 51.22 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.js +0.22% 296.51 kB 297.18 kB +0.23% 53.65 kB 53.78 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.js +0.22% 278.52 kB 279.13 kB +0.23% 49.56 kB 49.67 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.js +0.22% 278.59 kB 279.20 kB +0.24% 49.58 kB 49.70 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.js +0.22% 304.23 kB 304.90 kB +0.21% 53.51 kB 53.62 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.js +0.22% 279.56 kB 280.17 kB +0.22% 49.33 kB 49.44 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.js +0.22% 279.63 kB 280.24 kB +0.22% 49.35 kB 49.46 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.js +0.22% 284.42 kB 285.03 kB +0.21% 51.76 kB 51.87 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.js +0.22% 284.50 kB 285.11 kB +0.21% 51.79 kB 51.90 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.js +0.21% 292.49 kB 293.10 kB +0.22% 51.61 kB 51.72 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.js +0.21% 292.56 kB 293.17 kB +0.21% 51.64 kB 51.75 kB

Generated by 🚫 dangerJS against 019b9dd

Fizz previously identified a task that was rendering during an abort by marking its blocked Segment as `RENDERING`. This does not work for resumed replay tasks because they do not have a Segment, so an abort during replay could eagerly abort the task before it unwound and then report the internal `null` throw instead of the abort reason.

Track the task currently executing on the Request so aborting can leave the in-flight task to unwind through its normal error path for both render and replay tasks. Since this replaces the only purpose of the Segment `RENDERING` status, remove that status and its associated bookkeeping.

When resumed work unwinds after aborting, use the request's abort reason in the replay catch paths so aborting while replaying a prerendered tree or while rendering a resumed segment reports the meaningful abort reason instead of the internal control-flow value.
@gnoff gnoff force-pushed the jstory/resume-abort branch from 059f19e to 019b9dd Compare May 31, 2026 20:52
@gnoff gnoff merged commit de8e005 into facebook:main May 31, 2026
237 checks passed
@gnoff gnoff deleted the jstory/resume-abort branch May 31, 2026 21:01
github-actions Bot pushed a commit that referenced this pull request May 31, 2026
Stacked on #36583

Fizz previously identified a task that was rendering during an abort by
marking its blocked Segment as `RENDERING`. This does not work for
resumed replay tasks because they do not have a Segment, so an abort
during replay could eagerly abort the task before it unwound and then
report the internal `null` throw instead of the abort reason.

Track the task currently executing on the Request so aborting can leave
the in-flight task to unwind through its normal error path for both
render and replay tasks. Since this replaces the only purpose of the
Segment `RENDERING` status, remove that status and its associated
bookkeeping.

When resumed work unwinds after aborting, use the request's abort reason
in the replay catch paths so aborting while replaying a prerendered tree
or while rendering a resumed segment reports the meaningful abort reason
instead of the internal control-flow value.

DiffTrain build for [de8e005](de8e005)
github-actions Bot pushed a commit to code/lib-react that referenced this pull request Jun 1, 2026
Stacked on facebook#36583

Fizz previously identified a task that was rendering during an abort by
marking its blocked Segment as `RENDERING`. This does not work for
resumed replay tasks because they do not have a Segment, so an abort
during replay could eagerly abort the task before it unwound and then
report the internal `null` throw instead of the abort reason.

Track the task currently executing on the Request so aborting can leave
the in-flight task to unwind through its normal error path for both
render and replay tasks. Since this replaces the only purpose of the
Segment `RENDERING` status, remove that status and its associated
bookkeeping.

When resumed work unwinds after aborting, use the request's abort reason
in the replay catch paths so aborting while replaying a prerendered tree
or while rendering a resumed segment reports the meaningful abort reason
instead of the internal control-flow value.

DiffTrain build for [de8e005](facebook@de8e005)
github-actions Bot pushed a commit to srpatcha/react that referenced this pull request Jun 1, 2026
Stacked on facebook#36583

Fizz previously identified a task that was rendering during an abort by
marking its blocked Segment as `RENDERING`. This does not work for
resumed replay tasks because they do not have a Segment, so an abort
during replay could eagerly abort the task before it unwound and then
report the internal `null` throw instead of the abort reason.

Track the task currently executing on the Request so aborting can leave
the in-flight task to unwind through its normal error path for both
render and replay tasks. Since this replaces the only purpose of the
Segment `RENDERING` status, remove that status and its associated
bookkeeping.

When resumed work unwinds after aborting, use the request's abort reason
in the replay catch paths so aborting while replaying a prerendered tree
or while rendering a resumed segment reports the meaningful abort reason
instead of the internal control-flow value.

DiffTrain build for [de8e005](facebook@de8e005)
github-actions Bot pushed a commit to srpatcha/react that referenced this pull request Jun 1, 2026
Stacked on facebook#36583

Fizz previously identified a task that was rendering during an abort by
marking its blocked Segment as `RENDERING`. This does not work for
resumed replay tasks because they do not have a Segment, so an abort
during replay could eagerly abort the task before it unwound and then
report the internal `null` throw instead of the abort reason.

Track the task currently executing on the Request so aborting can leave
the in-flight task to unwind through its normal error path for both
render and replay tasks. Since this replaces the only purpose of the
Segment `RENDERING` status, remove that status and its associated
bookkeeping.

When resumed work unwinds after aborting, use the request's abort reason
in the replay catch paths so aborting while replaying a prerendered tree
or while rendering a resumed segment reports the meaningful abort reason
instead of the internal control-flow value.

DiffTrain build for [de8e005](facebook@de8e005)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants