Skip to content

Commit 3bb8266

Browse files
committed
chore: Update deps
- Bump versions of multiple crates - Introduce new env var `P_SQL_TIMEOUT` to let users control timeout for SQL execution (defaults to 300s)
1 parent 3899a1b commit 3bb8266

4 files changed

Lines changed: 71 additions & 39 deletions

File tree

Cargo.toml

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -63,52 +63,43 @@ base64 = "0.22.0"
6363
cookie = "0.18.1"
6464
hex = "0.4"
6565
openid = { version = "0.18.3", default-features = false, features = ["rustls"] }
66-
rustls = { version = "0.23", default-features = false, features = [
66+
rustls = { version = "0.23.40", default-features = false, features = [
6767
"ring",
6868
"std",
6969
] }
7070
rustls-pemfile = "2.1.2"
7171
sha2 = "0.10.8"
7272

7373
# Serialization and Data Formats
74-
byteorder = "1.4.3"
74+
byteorder = "1.5.0"
7575
erased-serde = "=0.3.16"
76-
serde = { version = "1.0", features = ["rc", "derive"] }
77-
serde_json = "1.0"
78-
serde_repr = "0.1.17"
76+
serde = { version = "1.0.228", features = ["rc", "derive"] }
77+
serde_json = "1.0.150"
78+
serde_repr = "0.1.20"
7979

8080
# Async and Runtime
81-
async-trait = "0.1"
82-
futures = "0.3"
83-
futures-util = "0.3"
84-
tokio = { version = "^1.43", default-features = false, features = [
81+
async-trait = "0.1.89"
82+
futures = "0.3.32"
83+
futures-util = "0.3.32"
84+
tokio = { version = "^1.52.3", default-features = false, features = [
8585
"sync",
8686
"macros",
8787
"fs",
8888
"rt-multi-thread",
8989
] }
90-
tokio-stream = { version = "0.1.17", features = ["fs"] }
91-
tokio-util = { version = "0.7" }
90+
tokio-stream = { version = "0.1.18", features = ["fs"] }
91+
tokio-util = { version = "0.7.18" }
9292

9393
# perf
9494
hotpath = { version = "0.16.0", optional = true, features = [
9595
"hotpath",
9696
"hotpath-cpu",
9797
"hotpath-alloc",
98-
"tokio"
98+
"tokio",
9999
] }
100100

101101
# # Logging and Metrics
102-
# opentelemetry-proto = { version = "0.30.0", features = [
103-
# "gen-tonic",
104-
# "with-serde",
105-
# "logs",
106-
# "metrics",
107-
# "trace",
108-
# ] }
109-
110-
# add custom branch with fix until it gets merged
111-
opentelemetry-proto = { git = "https://github.com/open-telemetry/opentelemetry-rust/", rev = "b096b70b2ffe9beb65a716cf47d5e5db80a9e930", features = [
102+
opentelemetry-proto = { version = "0.32.0", features = [
112103
"gen-tonic",
113104
"with-serde",
114105
"logs",
@@ -147,7 +138,7 @@ humantime-serde = "1.1"
147138
# File System and I/O
148139
fs_extra = "1.3"
149140
path-clean = "1.0.1"
150-
relative-path = { version = "1.7", features = ["serde"] }
141+
relative-path = { version = "2.0.1", features = ["serde"] }
151142

152143
# CLI and System
153144
clap = { version = "4.5", default-features = false, features = [
@@ -159,21 +150,21 @@ clap = { version = "4.5", default-features = false, features = [
159150
"cargo",
160151
"error-context",
161152
] }
162-
crossterm = "0.28.1"
153+
crossterm = "0.29.0"
163154
hostname = "0.4.0"
164155
human-size = "0.4"
165156
num_cpus = "1.15"
166-
sysinfo = "0.33.1"
157+
sysinfo = { version = "0.34.2", features = ["multithread"] }
167158
uptime_lib = "0.3.0"
168159

169160
# Utility Libraries
170161
anyhow = { version = "1.0", features = ["backtrace"] }
171162
bytes = "1.11"
172163
clokwerk = "0.4"
173164
derive_more = { version = "1", features = ["full"] }
174-
itertools = "0.14"
165+
itertools = "0.15.0"
175166
once_cell = "1.20"
176-
rayon = "1.8"
167+
rayon = "1.12.0"
177168
rand = "0.8.5"
178169
regex = "1.12.2"
179170
reqwest = { version = "0.12", default-features = false, features = [
@@ -186,31 +177,44 @@ reqwest = { version = "0.12", default-features = false, features = [
186177
semver = "1.0"
187178
static-files = "0.2"
188179
thiserror = "2.0"
189-
ulid = { version = "1.0", features = ["serde"] }
190-
uuid = { version = "1", features = ["v4"] }
191-
xxhash-rust = { version = "0.8", features = ["xxh3"] }
192-
rustc-hash = "2"
180+
ulid = { version = "1.2.1", features = ["serde"] }
181+
uuid = { version = "1.23.3", features = ["v4"] }
182+
xxhash-rust = { version = "0.8.15", features = ["xxh3"] }
183+
rustc-hash = "2.1.2"
193184
futures-core = "0.3.31"
194185
tempfile = "3.20.0"
195186
lazy_static = "1.4.0"
196187
prost = "0.13.1"
197-
dashmap = "6.1.0"
188+
dashmap = "6.2.1"
198189
parking_lot = "0.12.5"
199-
indexmap = { version = "2.13.0", features = ["serde"] }
190+
indexmap = { version = "2.14.0", features = ["serde"] }
191+
192+
[target.'cfg(not(target_env = "msvc"))'.dependencies]
193+
tikv-jemallocator = { version = "0.7.0", features = [
194+
"profiling",
195+
"stats",
196+
"background_threads",
197+
] }
198+
tikv-jemalloc-ctl = { version = "0.7.0", features = ["stats"] }
200199

201200
[build-dependencies]
202-
cargo_toml = "0.21"
201+
cargo_toml = "0.22.3"
203202
sha1_smol = { version = "1.0", features = ["std"] }
204203
static-files = "0.2"
205204
ureq = "2.12"
206205
url = "2.5"
207-
vergen-gitcl = { version = "1.0", features = ["build", "cargo", "rustc", "si"] }
208-
zip = { version = "2.3", default-features = false, features = ["deflate"] }
206+
vergen-gitcl = { version = "9.1.0", features = [
207+
"build",
208+
"cargo",
209+
"rustc",
210+
"si",
211+
] }
212+
zip = { version = "8.6.0", default-features = false, features = ["deflate"] }
209213
anyhow = "1.0"
210214

211215
[dev-dependencies]
212-
rstest = "0.23.0"
213-
arrow = "58.0.0"
216+
rstest = "0.26.1"
217+
arrow = "59.0.0"
214218
temp-dir = "0.1.14"
215219

216220
[package.metadata.parseable_ui]

src/cli.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,16 @@ pub struct Options {
196196
)]
197197
pub max_connections: usize,
198198

199+
// SQL timeout in seconds
200+
#[arg(
201+
long,
202+
env = "P_SQL_TIMEOUT",
203+
default_value = "300",
204+
value_parser = value_parser!(u64).range(5..),
205+
help = "SQL execution timeout"
206+
)]
207+
pub sql_timeout: u64,
208+
199209
// DataFusion target partitions
200210
#[arg(
201211
long,

src/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ use tracing_subscriber::{EnvFilter, Registry, fmt};
3535
#[cfg_attr(feature = "hotpath", hotpath::main)]
3636
async fn main() -> anyhow::Result<()> {
3737
init_logger();
38+
39+
#[cfg(not(target_env = "msvc"))]
40+
use tikv_jemallocator::Jemalloc;
41+
42+
#[cfg(not(target_env = "msvc"))]
43+
#[global_allocator]
44+
static GLOBAL: Jemalloc = Jemalloc;
45+
3846
// Install the rustls crypto provider before any TLS operations.
3947
// This is required for rustls 0.23+ which needs an explicit crypto provider.
4048
// If the installation fails, log a warning but continue execution.

src/query/mod.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,14 @@ impl InMemorySessionContext {
144144
pub async fn execute(query: Query, is_streaming: bool, tenant_id: &Option<String>) -> QueryResult {
145145
let id = tenant_id.clone();
146146
QUERY_RUNTIME
147-
.spawn(async move { query.execute(is_streaming, &id).await })
147+
.spawn(async move {
148+
tokio::time::timeout(
149+
std::time::Duration::from_secs(PARSEABLE.options.sql_timeout),
150+
query.execute(is_streaming, &id),
151+
)
152+
.await
153+
.map_err(|e| ExecuteError::Timeout(e, PARSEABLE.options.sql_timeout))?
154+
})
148155
.await
149156
.expect("The Join should have been successful")
150157
}
@@ -903,6 +910,7 @@ pub fn flatten_objects_for_count(objects: Vec<Value>) -> Vec<Value> {
903910
pub mod error {
904911
use crate::{parseable::StreamNotFound, storage::ObjectStorageError};
905912
use datafusion::error::DataFusionError;
913+
use tokio::time::error::Elapsed;
906914

907915
#[derive(Debug, thiserror::Error)]
908916
pub enum ExecuteError {
@@ -912,6 +920,8 @@ pub mod error {
912920
Datafusion(#[from] DataFusionError),
913921
#[error("{0}")]
914922
StreamNotFound(#[from] StreamNotFound),
923+
#[error("{0}: {1}s")]
924+
Timeout(Elapsed, u64),
915925
}
916926
}
917927

0 commit comments

Comments
 (0)