Repository navigation
feat: log available_parallelism() and version, structured, at startup - #765
Merged
Merged
Conversation
brawer
force-pushed
the
log-available-parallelism
branch
from
August 24, 2026 18:30
dacda93 to
2e3ef39
Compare
Every internal thread pool (prune.rs/assemble.rs's own num_workers, Rayon's default global pool for conflate.match) sizes itself from std::thread::available_parallelism() -- which historically ignored Docker/podman's --cpus (a CFS bandwidth quota, not a cpuset) and just reported the host's full core count. Rust's std did fix this for cgroup v2 (rust-lang/rust#89310), and this toolchain (1.98) is well past that fix, but it's exactly the kind of library behavior worth confirming empirically rather than trusting -- this is that confirmation mechanism, for whenever a --cpus sweep (see docs/PRODUCTION.md) actually happens: log the value once, structured, and check it matches N under a real --cpus=N. While touching this call site: also moves the pipeline version out of the message text and into a structured field, matching this module's own documented convention (logging.rs's own doc comment: "Call sites that have actual structured data to log ... should attach it via the log crate's key-value API instead of interpolating it into the message text") -- the version was doing exactly that before. Keeps the "vX.Y.Z" form (concat!("v", env!("CARGO_PKG_VERSION")), a zero-cost compile-time concatenation of two string literals, not a runtime format!) to match both the previously-logged string and the release tag format (see RELEASING.md) -- not the bare semver pipeline::provenance's tool_component() uses, which is a different field for a different purpose. Extends logging::init()'s existing one-time startup log record rather than adding a second one -- already the natural, only-runs-once home for this kind of environment fact. Verified: cargo test (253 passed, extended the existing startup-record test to check both new structured fields instead of parsing the old message string)/clippy/fmt clean. Manually ran against the zugerland.osm.pbf fixture and confirmed the real JSON shape: {"fields":{"available_parallelism":10,"version":"v0.8.2"},..., "message":"pipeline starting up",...} Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
brawer
force-pushed
the
log-available-parallelism
branch
from
August 24, 2026 18:47
2e3ef39 to
1b5323a
Compare
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.
Why
Every internal thread pool (
prune.rs/assemble.rs's ownnum_workers, Rayon's default global pool forconflate.match) sizes itself fromstd::thread::available_parallelism()-- which historically ignored Docker/podman's--cpus(a CFS bandwidth quota, not acpuset) and just reported the host's full core count. Rust's std did fix this for cgroup v2 (rust-lang/rust#89310), and this toolchain (1.98) is well past that fix, but it's exactly the kind of library behavior worth confirming empirically rather than trusting -- this is that confirmation mechanism, for whenever a--cpussweep (seedocs/PRODUCTION.md) actually happens: log the value once, structured, and check it matches N under a real--cpus=N.What
Extends
logging::init()'s existing one-time startup log record rather than adding a second one -- already the natural, only-runs-once home for this kind of environment fact.While touching this call site: also moves the pipeline version out of the message text and into a structured field, matching this module's own documented convention (
logging.rs's own doc comment: "Call sites that have actual structured data to log ... should attach it via thelogcrate's key-value API instead of interpolating it into the message text") -- the version was doing exactly that before. Keeps the"vX.Y.Z"form (concat!("v", env!("CARGO_PKG_VERSION")), a zero-cost compile-time concatenation of two string literals, not a runtimeformat!) to match both the previously-logged string and the release tag format (seeRELEASING.md) -- not the bare semverpipeline::provenance'stool_component()uses, which is a different field for a different purpose.Testing
cargo test(253 passed, extended the existing startup-record test to check both new structured fields instead of parsing the old message string)/clippy/fmtclean. Manually ran against thezugerland.osm.pbffixture and confirmed the real JSON shape:{"fields":{"available_parallelism":10,"version":"v0.8.2"},...,"message":"pipeline starting up",...}🤖 Generated with Claude Code