Skip to content

Commit 513ba7a

Browse files
authored
Fix potential overflow when we print verbose physical plan (#17798) (#17804)
1 parent 0aa2938 commit 513ba7a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

datafusion/core/src/physical_planner.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,15 @@ impl DefaultPhysicalPlanner {
20932093
"Optimized physical plan:\n{}\n",
20942094
displayable(new_plan.as_ref()).indent(false)
20952095
);
2096-
debug!("Detailed optimized physical plan:\n{new_plan:?}");
2096+
2097+
// Don't print new_plan directly, as that may overflow the stack.
2098+
// For example:
2099+
// thread 'tokio-runtime-worker' has overflowed its stack
2100+
// fatal runtime error: stack overflow, aborting
2101+
debug!(
2102+
"Detailed optimized physical plan:\n{}\n",
2103+
displayable(new_plan.as_ref()).indent(true)
2104+
);
20972105
Ok(new_plan)
20982106
}
20992107

0 commit comments

Comments
 (0)