Unverified Commit 7a36a464 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Turbopack: avoid inheriting span into effect (#75196)

That only causes incomplete spans in the tracing when the Span is
cached.
parent ea1072f3
...@@ -30,7 +30,6 @@ type EffectFuture = Pin<Box<dyn Future<Output = Result<()>> + Send + Sync + 'sta ...@@ -30,7 +30,6 @@ type EffectFuture = Pin<Box<dyn Future<Output = Result<()>> + Send + Sync + 'sta
/// The inner state of an effect instance if it has not been applied yet. /// The inner state of an effect instance if it has not been applied yet.
struct EffectInner { struct EffectInner {
future: EffectFuture, future: EffectFuture,
span: Span,
} }
enum EffectState { enum EffectState {
...@@ -51,7 +50,6 @@ impl EffectInstance { ...@@ -51,7 +50,6 @@ impl EffectInstance {
Self { Self {
inner: Mutex::new(EffectState::NotStarted(EffectInner { inner: Mutex::new(EffectState::NotStarted(EffectInner {
future: Box::pin(future), future: Box::pin(future),
span: Span::current(),
})), })),
} }
} }
...@@ -87,10 +85,10 @@ impl EffectInstance { ...@@ -87,10 +85,10 @@ impl EffectInstance {
State::Started(listener) => { State::Started(listener) => {
listener.await; listener.await;
} }
State::NotStarted(EffectInner { future, span }) => { State::NotStarted(EffectInner { future }) => {
let join_handle = tokio::spawn( let join_handle = tokio::spawn(
turbo_tasks_future_scope(turbo_tasks::turbo_tasks(), future) turbo_tasks_future_scope(turbo_tasks::turbo_tasks(), future)
.instrument(span), .instrument(Span::current()),
); );
let result = match join_handle.await { let result = match join_handle.await {
Ok(Err(err)) => Err(SharedError::new(err)), Ok(Err(err)) => Err(SharedError::new(err)),
......
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