Skip to content

Commit

Permalink
only the first task read need to be strongly consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jan 29, 2025
1 parent 5aa6d9e commit 08f8873
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions turbopack/crates/turbo-tasks/src/raw_vc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl RawVc {
self.resolve_inner(ReadConsistency::Strong).await
}

async fn resolve_inner(self, consistency: ReadConsistency) -> Result<RawVc> {
async fn resolve_inner(self, mut consistency: ReadConsistency) -> Result<RawVc> {
let tt = turbo_tasks();
let mut current = self;
let mut notified = false;
Expand All @@ -221,6 +221,10 @@ impl RawVc {
notified = true;
}
current = read_task_output(&*tt, task, consistency).await?;
// We no longer need to read strongly consistent, as any Vc returned
// from the first task will be inside of the scope of the first
// task. So it's already strongly consistent.
consistency = ReadConsistency::Eventual;
}
RawVc::TaskCell(_, _) => return Ok(current),
RawVc::LocalOutput(task_id, local_cell_id) => {
Expand Down Expand Up @@ -396,8 +400,7 @@ impl Future for ReadRawVcFuture {
Ok(Ok(vc)) => {
// We no longer need to read strongly consistent, as any Vc returned
// from the first task will be inside of the scope of the first
// task. So it's already strongly
// consistent.
// task. So it's already strongly consistent.
this.consistency = ReadConsistency::Eventual;
this.current = vc;
continue 'outer;
Expand Down

0 comments on commit 08f8873

Please sign in to comment.