diff --git a/Cargo.lock b/Cargo.lock index e6db56ce30..b2a252c97f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3562,6 +3562,7 @@ dependencies = [ "strum", "tempfile", "tokio", + "tracing", "typed-builder", "typetag", "url", diff --git a/crates/iceberg/Cargo.toml b/crates/iceberg/Cargo.toml index 159a7da7f2..9353a31842 100644 --- a/crates/iceberg/Cargo.toml +++ b/crates/iceberg/Cargo.toml @@ -75,6 +75,7 @@ serde_repr = { workspace = true } serde_with = { workspace = true } strum = { workspace = true, features = ["derive"] } tokio = { workspace = true, optional = false } +tracing = { workspace = true } typed-builder = { workspace = true } typetag = { workspace = true } url = { workspace = true } diff --git a/crates/iceberg/src/util/mod.rs b/crates/iceberg/src/util/mod.rs index 28eda66d49..3cf2eef9b0 100644 --- a/crates/iceberg/src/util/mod.rs +++ b/crates/iceberg/src/util/mod.rs @@ -35,11 +35,11 @@ const DEFAULT_PARALLELISM: usize = 1; /// parallelism can change during the lifetime of an executing /// process, but this should not be called in a hot loop. pub(crate) fn available_parallelism() -> NonZeroUsize { - std::thread::available_parallelism().unwrap_or_else(|_err| { - // Failed to get the level of parallelism. - // TODO: log/trace when this fallback occurs. - - // Using a default value. + std::thread::available_parallelism().unwrap_or_else(|err| { + tracing::warn!( + error = %err, + "Failed to determine available parallelism; falling back to {DEFAULT_PARALLELISM}", + ); NonZeroUsize::new(DEFAULT_PARALLELISM).unwrap() }) }