Skip to content

Commit f928b26

Browse files
committed
reduce the locking range in metrics_to_string.
1 parent f9e5d0c commit f928b26

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

query_engine/src/datafusion_impl/physical_plan.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,13 @@ impl PhysicalPlan for DataFusionPhysicalPlanAdapter {
140140
}
141141

142142
fn metrics_to_string(&self) -> String {
143-
let executed_opt = &*self.executed_plan.read().unwrap();
143+
let executed_opt = { self.executed_plan.read().unwrap().clone() };
144+
144145
match executed_opt {
145146
Some(plan) => DisplayableExecutionPlan::with_metrics(plan.as_ref())
146147
.indent(true)
147148
.to_string(),
148-
None => "Plan is not executed yet".to_string(),
149+
None => "plan is not executed yet".to_string(),
149150
}
150151
}
151152
}

0 commit comments

Comments
 (0)