Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
5dc09678
Unverified
Commit
5dc09678
authored
Mar 03, 2025
by
Tobias Koppers
Committed by
GitHub
Mar 03, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: avoid panic in module batches (#76757)
Because of eventual consistency
parent
9118a0b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
module_batches.rs
.../crates/turbopack-core/src/module_graph/module_batches.rs
+5
-5
No files found.
turbopack/crates/turbopack-core/src/module_graph/module_batches.rs
View file @
5dc09678
...
@@ -4,7 +4,7 @@ use std::{
...
@@ -4,7 +4,7 @@ use std::{
mem
::
take
,
mem
::
take
,
};
};
use
anyhow
::{
bail
,
Result
};
use
anyhow
::{
bail
,
Context
,
Result
};
use
either
::
Either
;
use
either
::
Either
;
use
petgraph
::
graph
::{
DiGraph
,
EdgeIndex
,
NodeIndex
};
use
petgraph
::
graph
::{
DiGraph
,
EdgeIndex
,
NodeIndex
};
use
rustc_hash
::{
FxHashMap
,
FxHashSet
,
FxHasher
};
use
rustc_hash
::{
FxHashMap
,
FxHashSet
,
FxHasher
};
...
@@ -254,7 +254,7 @@ impl PreBatches {
...
@@ -254,7 +254,7 @@ impl PreBatches {
let
entry_chunk_groups
=
chunk_group_info
let
entry_chunk_groups
=
chunk_group_info
.module_chunk_groups
.module_chunk_groups
.get
(
&
ResolvedVc
::
upcast
(
entry
))
.get
(
&
ResolvedVc
::
upcast
(
entry
))
.
expect
(
"all modules need to have chunk group info"
)
;
.
context
(
"all modules need to have chunk group info"
)
?
;
let
mut
state
=
TraversalState
{
let
mut
state
=
TraversalState
{
items
:
Vec
::
new
(),
items
:
Vec
::
new
(),
this
:
self
,
this
:
self
,
...
@@ -279,7 +279,7 @@ impl PreBatches {
...
@@ -279,7 +279,7 @@ impl PreBatches {
let
chunk_groups
=
chunk_group_info
let
chunk_groups
=
chunk_group_info
.module_chunk_groups
.module_chunk_groups
.get
(
&
node
.module
)
.get
(
&
node
.module
)
.
expect
(
"all modules need to have chunk group info"
)
;
.
context
(
"all modules need to have chunk group info"
)
?
;
if
chunk_groups
!=
entry_chunk_groups
{
if
chunk_groups
!=
entry_chunk_groups
{
let
idx
=
state
.this
.ensure_pre_batch_for_module
(
let
idx
=
state
.this
.ensure_pre_batch_for_module
(
chunkable_module
,
chunkable_module
,
...
@@ -340,7 +340,7 @@ pub async fn compute_module_batches(
...
@@ -340,7 +340,7 @@ pub async fn compute_module_batches(
let
chunk_groups
=
chunk_group_info
let
chunk_groups
=
chunk_group_info
.module_chunk_groups
.module_chunk_groups
.get
(
&
entry
)
.get
(
&
entry
)
.
expect
(
"all modules need to have chunk group info"
)
;
.
context
(
"all modules need to have chunk group info"
)
?
;
pre_batches
.ensure_pre_batch_for_module
(
pre_batches
.ensure_pre_batch_for_module
(
chunkable_module
,
chunkable_module
,
chunk_groups
,
chunk_groups
,
...
@@ -608,7 +608,7 @@ pub async fn compute_module_batches(
...
@@ -608,7 +608,7 @@ pub async fn compute_module_batches(
let
chunk_groups
=
chunk_group_info
let
chunk_groups
=
chunk_group_info
.module_chunk_groups
.module_chunk_groups
.get
(
&
module
)
.get
(
&
module
)
.
expect
(
"all modules need to have chunk group info"
)
;
.
context
(
"all modules need to have chunk group info"
)
?
;
let
key
=
BuildHasherDefault
::
<
FxHasher
>
::
default
()
.prehash
(
chunk_groups
.clone
());
let
key
=
BuildHasherDefault
::
<
FxHasher
>
::
default
()
.prehash
(
chunk_groups
.clone
());
batch_groups
batch_groups
.entry
(
key
)
.entry
(
key
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment