Skip to content

Commit

Permalink
Fix large futures causing stack overflows (#10033)
Browse files Browse the repository at this point in the history
* Enable clippy::pedantic::large_futures lint

* Lighten DataFrame size and fix large futures warnings
  • Loading branch information
sergiimk committed Apr 18, 2024
1 parent 88c98e1 commit da40cb9
Show file tree
Hide file tree
Showing 27 changed files with 232 additions and 70 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,7 @@ opt-level = 3
overflow-checks = false
panic = 'unwind'
rpath = false

[workspace.lints.clippy]
# Detects large stack-allocated futures that may cause stack overflow crashes (see threshold in clippy.toml)
large_futures = "warn"
3 changes: 3 additions & 0 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ repository = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }

[lints]
workspace = true

[features]
ci = []
default = ["mimalloc"]
Expand Down
4 changes: 4 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ disallowed-methods = [
disallowed-types = [
{ path = "std::time::Instant", reason = "Use `datafusion_common::instant::Instant` instead for WASM compatibility" },
]

# Lowering the threshold to help prevent stack overflows (default is 16384)
# See: https://rust-lang.github.io/rust-clippy/master/index.html#/large_futures
future-size-threshold = 10000
3 changes: 3 additions & 0 deletions datafusion-examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ license = { workspace = true }
authors = { workspace = true }
rust-version = { workspace = true }

[lints]
workspace = true

[[example]]
name = "flight_sql_server"
path = "examples/flight/flight_sql_server.rs"
Expand Down
3 changes: 3 additions & 0 deletions datafusion/common-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ license = { workspace = true }
authors = { workspace = true }
rust-version = { workspace = true }

[lints]
workspace = true

[lib]
name = "datafusion_common_runtime"
path = "src/lib.rs"
Expand Down
3 changes: 3 additions & 0 deletions datafusion/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ license = { workspace = true }
authors = { workspace = true }
rust-version = { workspace = true }

[lints]
workspace = true

[lib]
name = "datafusion_common"
path = "src/lib.rs"
Expand Down
3 changes: 3 additions & 0 deletions datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ authors = { workspace = true }
# https://github.com/foresterre/cargo-msrv/issues/590
rust-version = "1.73"

[lints]
workspace = true

[lib]
name = "datafusion"
path = "src/lib.rs"
Expand Down
Loading

0 comments on commit da40cb9

Please sign in to comment.