feat(iceberg): log warning when available_parallelism falls back to default#2520
Open
huan233usc wants to merge 1 commit into
Open
feat(iceberg): log warning when available_parallelism falls back to default#2520huan233usc wants to merge 1 commit into
huan233usc wants to merge 1 commit into
Conversation
…efault When `std::thread::available_parallelism()` fails, `available_parallelism()` silently falls back to `DEFAULT_PARALLELISM` (= 1). Both call sites (`TableScanBuilder::new`, `ArrowReaderBuilder::new`) use this value to size their internal concurrency, so a silent fallback turns parallel execution into serial with no signal to the operator. Emit a `tracing::warn!` carrying the underlying error so the degraded state is observable. Resolves the existing `TODO` in `util::available_parallelism`. The `iceberg` crate gains a direct `tracing` dependency; `tracing` is already declared at the workspace level and is the agreed logging facade (see apache#482).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Resolves the in-code
TODOatcrates/iceberg/src/util/mod.rs:40(no tracking issue).What changes are included in this PR?
When
std::thread::available_parallelism()fails,available_parallelism()falls back toDEFAULT_PARALLELISM(= 1). Both call sites —TableScanBuilder::newandArrowReaderBuilder::new— use this value to size their internal concurrency, so a silent fallback turns parallel execution into serial with no signal to the operator.This PR emits a
tracing::warn!carrying the underlying error so the degraded state is observable, e.g.:The
icebergcrate gains a directtracingdependency.tracingis already declared at the workspace level and is the agreed logging facade (per the conclusion of #482).Are these changes tested?
No new unit test.
std::thread::available_parallelism()succeeds on every standard CI environment and cannot be forced to fail without mocking the standard library, so a fallback-path test would require either:cfg(test)indirection layer to inject a mockavailable_parallelism(), orBoth seemed disproportionate for a one-line observability change. Existing callers (
TableScanBuilder,ArrowReaderBuilder) continue to receive a validNonZeroUsizeon success, exercised by the existing test suite. Happy to add either approach if reviewers prefer.Verified locally:
cargo check -p icebergcargo test -p iceberg --lib util::cargo clippy -p iceberg --all-targets -- -D warningscargo fmt -p iceberg --check