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
3b77a6e2
Commit
3b77a6e2
authored
Apr 01, 2026
by
Tobias Koppers
Committed by
Luke Sandberg
Apr 07, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix DashMap read-write self-deadlock in task_cache causing hangs (#92210)
parent
b2f208ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
mod.rs
turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
+7
-5
No files found.
turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
View file @
3b77a6e2
...
@@ -1474,8 +1474,9 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
...
@@ -1474,8 +1474,9 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
let
is_root
=
task_type
.native_fn.is_root
;
let
is_root
=
task_type
.native_fn.is_root
;
// First check if the task exists in the cache which only uses a read lock
// First check if the task exists in the cache which only uses a read lock
if
let
Some
(
task_id
)
=
self
.task_cache
.get
(
&
task_type
)
{
// .map(|r| *r) copies the TaskId and drops the DashMap Ref (releasing the read lock)
let
task_id
=
*
task_id
;
// before ConnectChildOperation::run, which may re-enter task_cache with a write lock.
if
let
Some
(
task_id
)
=
self
.task_cache
.get
(
&
task_type
)
.map
(|
r
|
*
r
)
{
self
.track_cache_hit
(
&
task_type
);
self
.track_cache_hit
(
&
task_type
);
self
.connect_child
(
self
.connect_child
(
parent_task
,
parent_task
,
...
@@ -1564,9 +1565,10 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
...
@@ -1564,9 +1565,10 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
/* cell_id */
None
,
/* cell_id */
None
,
);
);
}
}
// First check if the task exists in the cache which only uses a read lock
// First check if the task exists in the cache which only uses a read lock.
if
let
Some
(
task_id
)
=
self
.task_cache
.get
(
&
task_type
)
{
// .map(|r| *r) copies the TaskId and drops the DashMap Ref (releasing the read lock)
let
task_id
=
*
task_id
;
// before ConnectChildOperation::run, which may re-enter task_cache with a write lock.
if
let
Some
(
task_id
)
=
self
.task_cache
.get
(
&
task_type
)
.map
(|
r
|
*
r
)
{
self
.track_cache_hit
(
&
task_type
);
self
.track_cache_hit
(
&
task_type
);
self
.connect_child
(
self
.connect_child
(
parent_task
,
parent_task
,
...
...
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