Skip to content

Commit da40cb9

Browse files
authored
Fix large futures causing stack overflows (#10033)
* Enable clippy::pedantic::large_futures lint * Lighten DataFrame size and fix large futures warnings
1 parent 88c98e1 commit da40cb9

27 files changed

Lines changed: 232 additions & 70 deletions

File tree

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,7 @@ opt-level = 3
126126
overflow-checks = false
127127
panic = 'unwind'
128128
rpath = false
129+
130+
[workspace.lints.clippy]
131+
# Detects large stack-allocated futures that may cause stack overflow crashes (see threshold in clippy.toml)
132+
large_futures = "warn"

benchmarks/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ repository = { workspace = true }
2626
license = { workspace = true }
2727
rust-version = { workspace = true }
2828

29+
[lints]
30+
workspace = true
31+
2932
[features]
3033
ci = []
3134
default = ["mimalloc"]

clippy.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ disallowed-methods = [
66
disallowed-types = [
77
{ path = "std::time::Instant", reason = "Use `datafusion_common::instant::Instant` instead for WASM compatibility" },
88
]
9+
10+
# Lowering the threshold to help prevent stack overflows (default is 16384)
11+
# See: https://rust-lang.github.io/rust-clippy/master/index.html#/large_futures
12+
future-size-threshold = 10000

datafusion-examples/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ license = { workspace = true }
2929
authors = { workspace = true }
3030
rust-version = { workspace = true }
3131

32+
[lints]
33+
workspace = true
34+
3235
[[example]]
3336
name = "flight_sql_server"
3437
path = "examples/flight/flight_sql_server.rs"

datafusion/common-runtime/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ license = { workspace = true }
2828
authors = { workspace = true }
2929
rust-version = { workspace = true }
3030

31+
[lints]
32+
workspace = true
33+
3134
[lib]
3235
name = "datafusion_common_runtime"
3336
path = "src/lib.rs"

datafusion/common/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ license = { workspace = true }
2828
authors = { workspace = true }
2929
rust-version = { workspace = true }
3030

31+
[lints]
32+
workspace = true
33+
3134
[lib]
3235
name = "datafusion_common"
3336
path = "src/lib.rs"

datafusion/core/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ authors = { workspace = true }
3232
# https://github.com/foresterre/cargo-msrv/issues/590
3333
rust-version = "1.73"
3434

35+
[lints]
36+
workspace = true
37+
3538
[lib]
3639
name = "datafusion"
3740
path = "src/lib.rs"

0 commit comments

Comments
 (0)