fix a snapshot encoding error that could happen under concurrent mutation and snapshotting#92658
fix a snapshot encoding error that could happen under concurrent mutation and snapshotting#92658lukesandberg merged 2 commits intocanaryfrom
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
38ac61b to
bc66ee8
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
bc66ee8 to
5f7ce69
Compare
Tests Passed |
5f7ce69 to
c27d432
Compare
06eef17 to
dffcc78
Compare
Failing test suitesCommit: 16f0498 | About building and testing Next.js
Expand output● app dir - prefetching › should show layout eagerly when prefetched with loading one level down |
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: dffcc78 |
…tion and snapshotting
dffcc78 to
16f0498
Compare
Merge activity
|

What?
Fixes a snapshot encoding panic introduced by #89370 in
turbopack/crates/turbo-tasks-backend/src/backend/storage.rs.Why?
#89370 refactored snapshot iteration and in doing so introduced two incorrect assertions in
SnapshotShardIter::nextfor tasks in themodifiedlist that were re-modified during snapshot iteration:.expect("snapshot entry for modified_during_snapshot task must contain a value")— this panics in the(true, false)branch oftrack_modification_internal, where a task was modified in one category before the snapshot and then modified in a different category during iteration. The second modification stores aNoneentry insnapshots(because there was no pre-existing data to copy for that category), but the iterator unconditionally unwrappedSome.debug_assert!(!inner.flags.any_modified())— after clearing the livedata_modified/meta_modifiedflags and before promoting_during_snapshotflags, the old code asserted that no modified flags remained. This fires in the(true, true)branch because clearing the flags happens after the snapshot copy was taken, so the assert races with the flag state.How?
direct_snapshotsfast-path and themodifiedlist into a single path that handles both(true, true)and(true, false)cases gracefully: ifany_modified_during_snapshot()is set, check thesnapshotsmap — use theSome(copy)if present, otherwise fall back to live data (which is correct for theNone/first-time-modified case).(true, false)branch (modify_different_category_during_snapshot).