Skip to content

Commit cab08e5

Browse files
authored
Turbopack: handle non-serializable cell content for cell update operation (#86861)
### What? A `TypedSharedReference` might not be serializable, so we might not be able to serialize the UpdateCellOperation. This avoids the suspend points while we store non-serializable content.
1 parent b2cc3a2 commit cab08e5

File tree

1 file changed

+18
-1
lines changed
  • turbopack/crates/turbo-tasks-backend/src/backend/operation

1 file changed

+18
-1
lines changed

turbopack/crates/turbo-tasks-backend/src/backend/operation/update_cell.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,29 @@ impl UpdateCellOperation {
165165
in_progress.event.notify(usize::MAX);
166166
}
167167
}
168+
169+
fn is_serializable(&self) -> bool {
170+
match self {
171+
UpdateCellOperation::InvalidateWhenCellDependency {
172+
is_serializable_cell_content,
173+
..
174+
} => *is_serializable_cell_content,
175+
UpdateCellOperation::FinalCellChange {
176+
is_serializable_cell_content,
177+
..
178+
} => *is_serializable_cell_content,
179+
UpdateCellOperation::AggregationUpdate { .. } => true,
180+
UpdateCellOperation::Done => true,
181+
}
182+
}
168183
}
169184

170185
impl Operation for UpdateCellOperation {
171186
fn execute(mut self, ctx: &mut impl ExecuteContext) {
172187
loop {
173-
ctx.operation_suspend_point(&self);
188+
if self.is_serializable() {
189+
ctx.operation_suspend_point(&self);
190+
}
174191
match self {
175192
UpdateCellOperation::InvalidateWhenCellDependency {
176193
is_serializable_cell_content,

0 commit comments

Comments
 (0)