Unverified Commit f65b10a5 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

turbo-tasks: replace async resolve fns with custom Future types…

turbo-tasks: replace async resolve fns with custom Future types (ResolveRawVcFuture, ResolveVcFuture, ToResolvedVcFuture) (#91554)

### What?

Replace the `async fn resolve()`, `async fn
resolve_strongly_consistent()`, and `async fn to_resolved()` methods on
`RawVc`, `Vc<T>`, and `OperationVc<T>` with hand-written custom `Future`
implementations, following the existing `ReadRawVcFuture` pattern.

New types:
- **`ResolveRawVcFuture`** (`raw_vc.rs`) — core implementation, replaces
`async fn resolve_inner()`
- **`ResolveVcFuture<T>`** (`vc/mod.rs`) — typed wrapper over
`ResolveRawVcFuture`, returned by `Vc::resolve()`
- **`ResolveOperationVcFuture<T>`** (`vc/operation.rs`) — typed wrapper,
returned by `OperationVc::resolve()`
- **`ToResolvedVcFuture<T>`** (`vc/mod.rs`) — typed wrapper, returned by
`Vc::to_resolved()`

All new future types expose a `.strongly_consistent()` builder method,
enabling `resolve_strongly_consistent()` to be replaced by
`.resolve().strongly_consistent()` at call sites.

`ReadRawVcFuture` is also updated to delegate its phase-1 resolve loop
to `ResolveRawVcFuture` instead of duplicating the logic.
`std::task::ready!` is used throughout to simplify poll implementations.

Also adds `#[inline(never)]` to `ReadRawVcFuture::poll` and
`ResolveRawVcFuture::poll` to avoid inlining large poll implementations
into every await site.

### Why?

Performance, binary size, and improved API ergonomics:

- The hand-written `Future` pattern (already used by `ReadRawVcFuture`)
gives the compiler more predictable, smaller code than the state
machines generated for `async fn`. The `#[inline(never)]` attributes on
`poll` prevent large poll bodies from being duplicated at every await
site, which the async desugaring otherwise allows.
- The new builder API (`.resolve().strongly_consistent()`) is more
composable and removes the need for separate `_strongly_consistent`
method variants, reducing the number of methods on
`RawVc`/`Vc`/`OperationVc`.
- Having `ReadRawVcFuture` delegate to `ResolveRawVcFuture` removes the
duplicated resolve loop and ensures both paths stay in sync.

### How?

- `ResolveRawVcFuture` stores `current: RawVc`, `read_output_options:
ReadOutputOptions`, `strongly_consistent: bool`, and `listener:
Option<EventListener>`. Its `poll` replicates the loop from the old
`resolve_inner` using `try_read_task_output` / `try_read_local_output`.
- On `Err(listener)` from a `try_*` call, the listener is stored in
`self.listener` and `Poll::Pending` is returned. At the top of the loop,
`ready!(poll_listener(...))` re-polls it and short-circuits if still
pending.
- Consistency is downgraded to `Eventual` after the first `TaskOutput`
hop, matching the previous behavior.
- `strongly_consistent: true` keeps the
`SUPPRESS_EVENTUAL_CONSISTENCY_TOP_LEVEL_TASK_CHECK` suppression across
all polls (same logic as `ReadRawVcFuture`).
- `ReadRawVcFuture` now holds a `ResolveRawVcFuture` for phase 1 and
drives it via `Pin::new(&mut self.resolve).poll(cx)` before proceeding
to the cell read in phase 2. This eliminates the duplicated loop that
previously existed in both types.
- Typed wrappers (`ResolveVcFuture<T>`, `ResolveOperationVcFuture<T>`,
`ToResolvedVcFuture<T>`) delegate `poll` to the inner
`ResolveRawVcFuture` and map the output to the appropriate typed result.
- `OperationVc::resolve_strongly_consistent()` is removed; 16 call sites
updated to `.resolve().strongly_consistent()`.
- All new types implement `Unpin` and are exported from `lib.rs`.
- `std::task::ready!` is used in all `poll` implementations to reduce
boilerplate.

No behavioral changes — this is a pure implementation refactor.

### Binary size impact

A release build (`pnpm swc-build-native --release`) was measured before
and after the branch changes on the same merge-base commit (`a41bef94`):

| | Size |
|---|---|
| Base (`a41bef94`, before branch) | 199,690,656 bytes (~190.4 MB) |
| Branch (`6f7846f9`, after changes) | 199,252,384 bytes (~190.0 MB) |
| **Difference** | **−438,272 bytes (−428 KB, −0.22%)** |

The branch produces a slightly smaller binary. The reduction comes
primarily from the `#[inline(never)]` attributes preventing large `poll`
bodies from being duplicated at every await site.

---------
Co-authored-by: 's avatarTobias Koppers <sokra@users.noreply.github.com>
Co-authored-by: 's avatarClaude <noreply@anthropic.com>
parent f6663b75
......@@ -76,7 +76,7 @@ impl NextDynamicGraphs {
// `get_global_information_for_endpoint_inner` calls `take_collectibles()` when needed
let result_op = Self::new_operation(graphs, is_single_page);
let result_vc = if !is_single_page {
let result_vc = result_op.resolve_strongly_consistent().await?;
let result_vc = result_op.resolve().strongly_consistent().await?;
result_op.drop_collectibles::<Box<dyn Issue>>();
*result_vc
} else {
......@@ -274,7 +274,7 @@ impl ServerActionsGraphs {
// `get_global_information_for_endpoint_inner` calls `take_collectibles()` when needed
let result_op = Self::new_operation(graphs, is_single_page);
let result_vc = if !is_single_page {
let result_vc = result_op.resolve_strongly_consistent().await?;
let result_vc = result_op.resolve().strongly_consistent().await?;
result_op.drop_collectibles::<Box<dyn Issue>>();
*result_vc
} else {
......@@ -452,7 +452,7 @@ impl ClientReferencesGraphs {
// `get_global_information_for_endpoint_inner` calls `take_collectibles()` when needed
let result_op = Self::new_operation(graphs, is_single_page);
let result_vc = if !is_single_page {
let result_vc = result_op.resolve_strongly_consistent().await?;
let result_vc = result_op.resolve().strongly_consistent().await?;
result_op.drop_collectibles::<Box<dyn Issue>>();
*result_vc
} else {
......
......@@ -37,7 +37,7 @@ pub struct EntrypointsOperation {
async fn entrypoints_without_collectibles_operation(
entrypoints: OperationVc<Entrypoints>,
) -> Result<Vc<Entrypoints>> {
let _ = entrypoints.resolve_strongly_consistent().await?;
let _ = entrypoints.resolve().strongly_consistent().await?;
entrypoints.drop_collectibles::<Box<dyn Diagnostic>>();
entrypoints.drop_issues();
let _ = get_effects(entrypoints).await?;
......
......@@ -615,7 +615,8 @@ impl ProjectContainer {
container.connect().project()
}
let project = project_from_container_operation(this_op)
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
let project_fs = project_fs_operation(project)
.read_strongly_consistent()
......@@ -738,7 +739,8 @@ impl ProjectContainer {
let watch = new_options.watch;
let project = project_operation(self)
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
let prev_project_fs = project_fs_operation(project)
.read_strongly_consistent()
......@@ -756,7 +758,8 @@ impl ProjectContainer {
}
this.options_state.set(Some(new_options));
let project = project_operation(self)
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
let project_fs = project_fs_operation(project)
.read_strongly_consistent()
......@@ -1512,7 +1515,7 @@ impl Project {
} else {
// In development mode, we need to to take and drop the issues, otherwise every
// route will report all issues.
let vc = module_graphs_op.resolve_strongly_consistent().await?;
let vc = module_graphs_op.resolve().strongly_consistent().await?;
module_graphs_op.drop_issues();
*vc
};
......
......@@ -41,7 +41,7 @@ pub async fn main_inner(
.run(async {
let container_op = ProjectContainer::new_operation(rcstr!("next.js"), options.dev);
ProjectContainer::initialize(container_op, options).await?;
container_op.resolve_strongly_consistent().await
container_op.resolve().strongly_consistent().await
})
.await?;
......@@ -248,7 +248,7 @@ async fn endpoint_write_to_disk_with_effects(
endpoint: ResolvedVc<Box<dyn Endpoint>>,
) -> Result<Vc<EndpointOutputPaths>> {
let op = endpoint_write_to_disk_operation(endpoint);
let result = op.resolve_strongly_consistent().await?;
let result = op.resolve().strongly_consistent().await?;
get_effects(op).await?.apply().await?;
Ok(*result)
}
......
......@@ -588,7 +588,7 @@ pub fn project_new(
.run(async move {
let container_op = ProjectContainer::new_operation(rcstr!("next.js"), is_dev);
ProjectContainer::initialize(container_op, options).await?;
container_op.resolve_strongly_consistent().await
container_op.resolve().strongly_consistent().await
})
.or_else(|e| turbopack_ctx.throw_turbopack_internal_result(&e.into()))
.await?;
......
......@@ -12,7 +12,7 @@ static REGISTRATION: Registration = register!();
async fn test_emptied_cells() {
run(&REGISTRATION, || async {
let input_op = get_state_operation();
let input_vc = input_op.resolve_strongly_consistent().await?;
let input_vc = input_op.resolve().strongly_consistent().await?;
let input = input_op.read_strongly_consistent().await?;
input.state.set(0);
......
......@@ -12,7 +12,7 @@ static REGISTRATION: Registration = register!();
async fn test_emptied_cells_session_dependent() {
run(&REGISTRATION, || async {
let input_op = get_state_operation();
let input_vc = input_op.resolve_strongly_consistent().await?;
let input_vc = input_op.resolve().strongly_consistent().await?;
let input = input_op.read_strongly_consistent().await?;
input.state.set(0);
......
......@@ -21,7 +21,7 @@ fn create_state_operation() -> Vc<Step> {
async fn test_invalidation_map() {
run(&REGISTRATION, || async {
let state_op = create_state_operation();
let state_vc = state_op.resolve_strongly_consistent().await?;
let state_vc = state_op.resolve().strongly_consistent().await?;
let state = state_op.read_strongly_consistent().await?;
state.set(1);
......@@ -101,7 +101,7 @@ async fn get_value(map: OperationVc<Map>, key: String) -> Result<Vc<GetValueResu
async fn test_invalidation_set() {
run(&REGISTRATION, || async {
let state_op = create_state_operation();
let state_vc = state_op.resolve_strongly_consistent().await?;
let state_vc = state_op.resolve().strongly_consistent().await?;
let state = state_op.read_strongly_consistent().await?;
state.set(1);
......
......@@ -13,7 +13,7 @@ static REGISTRATION: Registration = register!();
async fn test_random_change() {
run_once(&REGISTRATION, || async {
let state_op = make_state_operation();
let state_vc = state_op.resolve_strongly_consistent().await?;
let state_vc = state_op.resolve().strongly_consistent().await?;
let state = state_op.read_strongly_consistent().await?;
let mut rng = StdRng::from_seed(Default::default());
......
......@@ -39,7 +39,8 @@ async fn test_eventual_read_in_top_level_task_fails() {
async fn test_cell_read_in_top_level_task_succeeds() {
run_once(&REGISTRATION, || async {
let cell = returns_value_operation()
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
let value = cell.await?;
assert_eq!(value.value, 42);
......
......@@ -3162,7 +3162,8 @@ mod tests {
tt.run_once(async move {
let fs = disk_file_system_operation(root)
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
let root_path = disk_file_system_root(fs);
......@@ -3269,7 +3270,8 @@ mod tests {
tt.run_once(async move {
let fs = disk_file_system_operation(root)
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
let root_path = disk_file_system_root(fs);
let symlinks_dir = root_path.join("_symlinks")?;
......
......@@ -103,10 +103,12 @@ pub async fn run(args: FsWatcher) -> anyhow::Result<()> {
tt.run_once(async move {
let invalidations = TransientInstance::new(PathInvalidations::default());
let project_fs = disk_file_system_operation(RcStr::from(fs_root.to_str().unwrap()))
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
let project_root = disk_file_system_root_operation(project_fs)
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?
.owned()
.await?;
......
......@@ -60,10 +60,12 @@ pub async fn run(args: SymlinkStress) -> anyhow::Result<()> {
tt.run_once(async move {
let project_fs = disk_file_system_operation(RcStr::from(fs_root.to_str().unwrap()))
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
let project_root = disk_file_system_root_operation(project_fs)
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?
.owned()
.await?;
......
......@@ -97,7 +97,7 @@ pub use crate::{
},
mapped_read_ref::MappedReadRef,
output::OutputContent,
raw_vc::{CellId, RawVc, ReadRawVcFuture},
raw_vc::{CellId, RawVc, ReadRawVcFuture, ResolveRawVcFuture},
read_options::{ReadCellOptions, ReadOutputOptions},
read_ref::ReadRef,
serialization_invalidation::SerializationInvalidator,
......@@ -112,8 +112,9 @@ pub use crate::{
value::{TransientInstance, TransientValue},
value_type::{TraitMethod, TraitType, ValueType},
vc::{
Dynamic, NonLocalValue, OperationValue, OperationVc, OptionVcExt, ReadVcFuture, ResolvedVc,
Upcast, UpcastStrict, ValueDefault, Vc, VcCast, VcCellCompareMode, VcCellKeyedCompareMode,
Dynamic, NonLocalValue, OperationValue, OperationVc, OptionVcExt, ReadVcFuture,
ResolveOperationVcFuture, ResolveVcFuture, ResolvedVc, ToResolvedVcFuture, Upcast,
UpcastStrict, ValueDefault, Vc, VcCast, VcCellCompareMode, VcCellKeyedCompareMode,
VcCellNewMode, VcDefaultRead, VcRead, VcTransparentRead, VcValueTrait, VcValueTraitCast,
VcValueType, VcValueTypeCast,
},
......
This diff is collapsed.
......@@ -14,6 +14,8 @@ use std::{
hash::{Hash, Hasher},
marker::PhantomData,
ops::Deref,
pin::Pin,
task::{Context, Poll},
};
use anyhow::Result;
......@@ -26,13 +28,13 @@ pub use self::{
cell_mode::{VcCellCompareMode, VcCellKeyedCompareMode, VcCellMode, VcCellNewMode},
default::ValueDefault,
local::NonLocalValue,
operation::{OperationValue, OperationVc},
operation::{OperationValue, OperationVc, ResolveOperationVcFuture},
read::{ReadOwnedVcFuture, ReadVcFuture, VcDefaultRead, VcRead, VcTransparentRead},
resolved::ResolvedVc,
traits::{Dynamic, Upcast, UpcastStrict, VcValueTrait, VcValueType},
};
use crate::{
CellId, RawVc,
CellId, RawVc, ResolveRawVcFuture,
debug::{ValueDebug, ValueDebugFormat, ValueDebugFormatString},
keyed::{KeyedAccess, KeyedEq},
registry,
......@@ -40,6 +42,78 @@ use crate::{
vc::read::{ReadContainsKeyedVcFuture, ReadKeyedVcFuture},
};
/// A future returned by [`Vc::resolve`] that resolves a [`Vc<T>`] to a cell.
///
/// To opt into strong consistency, use [`OperationVc::resolve`] which returns a
/// [`ResolveOperationVcFuture`] with a
/// [`.strongly_consistent()`][ResolveOperationVcFuture::strongly_consistent] method.
#[must_use]
pub struct ResolveVcFuture<T>
where
T: ?Sized,
{
pub(crate) inner: ResolveRawVcFuture,
pub(crate) _t: PhantomData<T>,
}
impl<T: ?Sized> Future for ResolveVcFuture<T> {
type Output = Result<Vc<T>>;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
// SAFETY: we are not moving self
let this = unsafe { self.get_unchecked_mut() };
// ResolveRawVcFuture: Unpin, so Pin::new is safe
Pin::new(&mut this.inner).poll(cx).map(|r| {
r.map(|node| Vc {
node,
_t: PhantomData,
})
})
}
}
impl<T: ?Sized> Unpin for ResolveVcFuture<T> {}
/// A future returned by [`Vc::to_resolved`] that resolves a [`Vc<T>`] to a [`ResolvedVc<T>`].
///
/// Use [`.strongly_consistent()`][Self::strongly_consistent] to opt into strong consistency.
#[must_use]
pub struct ToResolvedVcFuture<T>
where
T: ?Sized,
{
inner: ResolveRawVcFuture,
_t: PhantomData<T>,
}
impl<T: ?Sized> ToResolvedVcFuture<T> {
/// Make the resolution strongly consistent.
pub fn strongly_consistent(mut self) -> Self {
self.inner = self.inner.strongly_consistent();
self
}
}
impl<T: ?Sized> Future for ToResolvedVcFuture<T> {
type Output = Result<ResolvedVc<T>>;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
// SAFETY: we are not moving self
let this = unsafe { self.get_unchecked_mut() };
// ResolveRawVcFuture: Unpin, so Pin::new is safe
Pin::new(&mut this.inner).poll(cx).map(|r| {
r.map(|node| ResolvedVc {
node: Vc {
node,
_t: PhantomData,
},
})
})
}
}
impl<T: ?Sized> Unpin for ToResolvedVcFuture<T> {}
type VcReadTarget<T> = <<T as VcValueType>::Read as VcRead<T>>::Target;
#[doc = include_str!("README.md")]
......@@ -337,16 +411,23 @@ where
Ok(())
}
/// Do not use this: Use [`Vc::to_resolved`] instead. If you must have a resolved [`Vc`] type
/// and not a [`ResolvedVc`] type, simply deref the result of [`Vc::to_resolved`].
pub fn resolve(self) -> ResolveVcFuture<T> {
ResolveVcFuture {
inner: self.node.resolve(),
_t: PhantomData,
}
}
/// Resolve the reference until it points to a cell directly, and wrap the
/// result in a [`ResolvedVc`], which statically guarantees that the
/// [`Vc`] was resolved.
pub async fn to_resolved(self) -> Result<ResolvedVc<T>> {
Ok(ResolvedVc {
node: Vc {
node: self.node.resolve().await?,
_t: PhantomData,
},
})
pub fn to_resolved(self) -> ToResolvedVcFuture<T> {
ToResolvedVcFuture {
inner: self.node.resolve(),
_t: PhantomData,
}
}
/// Returns `true` if the reference is resolved, meaning the underlying [`RawVc`] uses the
......@@ -369,15 +450,6 @@ where
pub fn is_local(self) -> bool {
self.node.is_local()
}
/// Do not use this: Use [`OperationVc::resolve_strongly_consistent`] instead.
#[cfg(feature = "non_operation_vc_strongly_consistent")]
pub async fn resolve_strongly_consistent(self) -> Result<Self> {
Ok(Self {
node: self.node.resolve_strongly_consistent().await?,
_t: PhantomData,
})
}
}
impl<T> From<RawVc> for Vc<T>
......
use std::{fmt::Debug, hash::Hash, marker::PhantomData};
use std::{
fmt::Debug,
future::Future,
hash::Hash,
pin::Pin,
task::{Context, Poll},
};
use anyhow::Result;
use auto_hash_map::AutoSet;
......@@ -11,6 +17,41 @@ use crate::{
VcValueTraitCast, VcValueType, marker_trait::impl_auto_marker_trait, trace::TraceRawVcs,
};
/// A future returned by [`OperationVc::resolve`] that connects an [`OperationVc<T>`] and resolves
/// it to a [`ResolvedVc<T>`].
///
/// Use [`.strongly_consistent()`][Self::strongly_consistent] to opt into strong consistency.
#[must_use]
pub struct ResolveOperationVcFuture<T>
where
T: ?Sized,
{
inner: super::ResolveVcFuture<T>,
}
impl<T: ?Sized> ResolveOperationVcFuture<T> {
/// Make the resolution strongly consistent.
pub fn strongly_consistent(mut self) -> Self {
self.inner.inner = self.inner.inner.strongly_consistent();
self
}
}
impl<T: ?Sized> Future for ResolveOperationVcFuture<T> {
type Output = anyhow::Result<ResolvedVc<T>>;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
// SAFETY: we are not moving self
let this = unsafe { self.get_unchecked_mut() };
// ResolveVcFuture: Unpin, so Pin::new is safe
Pin::new(&mut this.inner)
.poll(cx)
.map(|r| r.map(|node| ResolvedVc { node }))
}
}
impl<T: ?Sized> Unpin for ResolveOperationVcFuture<T> {}
/// A "subtype" (can be converted via [`.connect()`]) of [`Vc`] that
/// represents a specific call (with arguments) to [a task][macro@crate::function].
///
......@@ -106,23 +147,20 @@ impl<T: ?Sized> OperationVc<T> {
}
}
/// [Connects the `OperationVc`][Self::connect] and [resolves][Vc::to_resolved] the reference
/// until it points to a cell directly in a [strongly
/// consistent][crate::ReadConsistency::Strong] way.
/// [Connects the `OperationVc`][Self::connect] and resolves the reference until it points to a
/// cell directly.
///
/// Resolving will wait for task execution to be finished, so that the returned [`ResolvedVc`]
/// points to a cell that stores a value.
///
/// Resolving is necessary to compare identities of [`Vc`]s.
///
/// This is async and will rethrow any fatal error that happened during task execution.
pub async fn resolve_strongly_consistent(self) -> Result<ResolvedVc<T>> {
Ok(ResolvedVc {
node: Vc {
node: self.connect().node.resolve_strongly_consistent().await?,
_t: PhantomData,
},
})
/// Use [`.strongly_consistent()`][ResolveOperationVcFuture::strongly_consistent] to opt into
/// strong consistency.
pub fn resolve(self) -> ResolveOperationVcFuture<T> {
ResolveOperationVcFuture {
inner: self.connect().resolve(),
}
}
/// [Connects the `OperationVc`][Self::connect] and returns a [strongly
......
......@@ -1134,7 +1134,7 @@ pub async fn handle_issues<T: Send>(
operation: Option<&str>,
) -> Result<()> {
let source_vc = source_op.connect();
let _ = source_op.resolve_strongly_consistent().await?;
let _ = source_op.resolve().strongly_consistent().await?;
let has_fatal = issue_reporter.report_issues(
TransientValue::new(Vc::into_raw(source_vc)),
......
......@@ -801,7 +801,7 @@ impl ModuleGraph {
// all issues such that they aren't emitted multiple times.
async move {
let result_op = compute_async_module_info(self.to_resolved().await?);
let result_vc = result_op.resolve_strongly_consistent().await?;
let result_vc = result_op.resolve().strongly_consistent().await?;
result_op.drop_collectibles::<Box<dyn Issue>>();
anyhow::Ok(*result_vc)
}
......
......@@ -84,7 +84,7 @@ pub async fn process_request_with_content_source(
let original_path = request.uri().path().to_string();
let request = http_request_to_source_request(request).await?;
let result_op = get_from_source_operation(source, TransientInstance::new(request));
let resolved_result = result_op.resolve_strongly_consistent().await?;
let resolved_result = result_op.resolve().strongly_consistent().await?;
apply_effects(result_op).await?;
let side_effects: AutoSet<ResolvedVc<Box<dyn ContentSourceSideEffect>>> =
result_op.peek_collectibles();
......
......@@ -65,7 +65,7 @@ struct ContentSourceWithIssues {
async fn get_source_with_issues_operation(
source_op: OperationVc<Box<dyn ContentSource>>,
) -> Result<Vc<ContentSourceWithIssues>> {
let _ = source_op.resolve_strongly_consistent().await?;
let _ = source_op.resolve().strongly_consistent().await?;
let effects = get_effects(source_op).await?;
Ok(ContentSourceWithIssues { source_op, effects }.cell())
}
......@@ -238,7 +238,7 @@ impl DevServerBuilder {
http::process_request_with_content_source(
// HACK: pass `source` here (instead of `resolved_source`
// because the underlying API wants to do it's own
// `resolve_strongly_consistent` call.
// `.resolve().strongly_consistent()` call.
//
// It's unlikely (the calls happen one-after-another), but this
// could cause inconsistency between the reported issues and
......
......@@ -88,7 +88,8 @@ pub async fn resolve_source_request(
let mut request_overwrites = (*request).clone();
let mut response_header_overwrites = Vec::new();
let mut route_tree = content_source_get_routes_operation(source)
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
'routes: loop {
let mut sources_op = route_tree_get_operation(route_tree, current_asset_path.clone());
......@@ -140,7 +141,8 @@ pub async fn resolve_source_request(
request_overwrites.uri = new_uri;
current_asset_path = new_asset_path.into();
route_tree = content_source_get_routes_operation(*source)
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
continue 'routes;
}
......
......@@ -612,7 +612,7 @@ async fn snapshot_issues(
run_result_op: OperationVc<RunTestResult>,
) -> Result<Vc<()>> {
let PreparedTest { path, .. } = &*prepared_test.await?;
let _ = run_result_op.resolve_strongly_consistent().await;
let _ = run_result_op.resolve().strongly_consistent().await;
let plain_issues = run_result_op
.peek_issues()
......
......@@ -224,7 +224,12 @@ async fn run(resource: PathBuf) -> Result<()> {
#[turbo_tasks::function(operation)]
async fn inner_operation(resource: RcStr) -> Result<Vc<()>> {
let out_op = run_test_operation(resource);
let out_vc = out_op.resolve_strongly_consistent().await?.owned().await?;
let out_vc = out_op
.resolve()
.strongly_consistent()
.await?
.owned()
.await?;
let plain_issues = out_op
.peek_issues()
......@@ -239,7 +244,7 @@ async fn run(resource: PathBuf) -> Result<()> {
#[turbo_tasks::function(operation)]
async fn extract_effects(op: OperationVc<()>) -> Result<Vc<Effects>> {
let _ = op.resolve_strongly_consistent().await?;
let _ = op.resolve().strongly_consistent().await?;
Ok(get_effects(op).await?.cell())
}
......
......@@ -485,7 +485,8 @@ fn node_file_trace<B: Backend + 'static>(
input.clone(),
directory.clone(),
)
.resolve_strongly_consistent()
.resolve()
.strongly_consistent()
.await?;
let duration = before_start.elapsed();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment