Skip to content

feat: log effective thread count at startup like dbt 1.x - #16690

Open
Shahzeb-DataEngineer wants to merge 2 commits into
dbt-labs:mainfrom
Shahzeb-DataEngineer:feat/concurrency-startup-log
Open

Shahzeb-DataEngineer wants to merge 2 commits into
dbt-labs:mainfrom
Shahzeb-DataEngineer:feat/concurrency-startup-log

Conversation

@Shahzeb-DataEngineer

Copy link
Copy Markdown

Description

dbt 1.x printed the thread count at the start of a run (Concurrency: 4 threads (target='dev')). dbt v2 prints nothing about threads, so there is no way to tell from the logs which value was actually used (profile, --threads, or the adapter default).

This PR logs the effective thread count once per invocation, in the same format, for runnable commands (run, test, build, seed, snapshot):

Concurrency: 4 threads (target='dev')

Implementation

  • Extracted the existing thread-resolution logic in set_runtime_max_parallelism (crates/dbt-main/src/compilation.rs) into a pure resolve_effective_threads helper — no behavior change to the pool cap itself.
  • After the cap is applied, the resolved value is emitted via emit_info_log_message (the standard plain INFO-line helper), scoped to runnable commands via a new is_runnable_command const fn (same set as RunTasksArgs::is_runnable), matching dbt 1.x semantics and keeping commands like parse/list/docs quiet.
  • Added unit tests for the resolution precedence (--threads flag > profile > adapter default, --threads 0 = as many as possible, --no-parallel = 1, adapter default never 0) and for the command scoping.
  • Added a changie changelog entry (Features) via changie new.

Verification

  • cargo fmt -p dbt-main -- --check is clean.
  • New unit tests added in compilation.rs (effective_threads_*, concurrency_line_commands_match_runnable_set).
  • Note: a full local cargo test was not feasible in this environment (cold dependency cache, multi-GB fetch); relying on CI for the full suite.

Related Issue

closes #16682

Log "Concurrency: N threads (target='X')" once per invocation for
runnable commands (run, test, build, seed, snapshot), using the
effective thread count after flag/profile/adapter-default resolution.
This restores the dbt 1.x startup line so run logs record which value
was actually used.

Signed-off-by: Shahzeb Ali <126076773+Shahzeb-DataEngineer@users.noreply.github.com>
@Shahzeb-DataEngineer
Shahzeb-DataEngineer requested a review from a team as a code owner October 10, 2026 05:20
Copilot AI balanced review requested due to automatic review settings October 10, 2026 05:20
@cla-bot

cla-bot Bot commented Oct 10, 2026

Copy link
Copy Markdown

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @Shahzeb-DataEngineer

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

codescene-delta-analysis[bot]

This comment was marked as outdated.

Signed-off-by: Shahzeb Ali <126076773+Shahzeb-DataEngineer@users.noreply.github.com>
@cla-bot

cla-bot Bot commented Oct 10, 2026

Copy link
Copy Markdown

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @Shahzeb-DataEngineer

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Log the effective thread count at startup, like dbt 1.x does ("Concurrency: N threads")

2 participants