[v2 Bug] Building large number of models with fail-fast flag skips the summary report
- Dominant language
- Rust
- Stars
- 13.8k
- Forks
- 2.6k
- Avg merge
- 21h 31m
- Merged PRs (30d)
- 56
Description
### Is this a new bug in dbt v2.x compared to the latest version of dbt 1.x?
- [x] I believe this is a new bug in dbt v2.x
- [x] I have searched the existing issues and could not find a duplicate
### Current Behavior
Running `dbt build` with `--fail-fast` on a large selection (~2500 nodes) suppresses the `Errors and Warnings` and `Execution Summary` sections. Only the terse `Failed [...] model ...` line appears, with no diagnostic detail.
```
$ dbt@2 build -s "*ctl*" -f --fail-fast
Finished [ 3.15s] hook reflect_data-on-run-start-0
Failed [ 0.19s] model theophilemoreau_2_central.ctl_peoplespheres__employee__updates (table)
Rendering [━╾ ] 175/2502 174 succeeded | 1 failed | 65 in-progress | 16 idle
[end of output]
```
The same failing model reports the full error when built alone, and the same large selection reports all errors correctly when `--fail-fast` is omitted — isolating the bug to `--fail-fast` + large selection.
| Selection | `--fail-fast` | Errors shown? |
|-----------|---------------|---------------|
| Single model | Yes | ✅ |
| ~2500 nodes | Yes | ❌ |
| ~2500 nodes | No | ✅ |
**Environment:** dbt-core 2.0.0-alpha.4 (pipx), BigQuery adapter (bundled), macOS 26 arm64.
### Expected Behavior
`--fail-fast` should halt the run *and* report the failure details, matching dbt-core v1.x behavior and the [documentation](https://docs.getdbt.com/reference/global-configs/failing-fast). Both the `Errors and Warnings` block (with error code, message, and source location) and the `Execution Summary` should print before the process exits, regardless of selection size.
**Impact:** In orchestrated environments (Dagster), engineers only see a model name in failure logs and must re-run against a single model to diagnose. Meaningful iteration cost.
**Suspected cause:** cancellation triggered by fail-fast likely exits the process before the summary writer flushes. Since the output pipeline works correctly at the same scale without `--fail-fast`, the fix is probably in the interrupt/cancellation path, not rendering.
### Steps To Reproduce
1. In a project with a large model graph (~2500+ nodes selected), introduce a failure in one model. Simplest way: add a `ref()` or `source()` to a table that doesn't exist in the target database.
```sql
-- models/broken_model.sql
select * from {{ ref('does_not_exist') }}
```
2. Run a large selection with `--fail-fast`:
```bash
dbt@2 build -s "*" --fail-fast --target dev
```
3. Observe: only the `Failed [...] model ...` line prints. No `Errors and Warnings` section, no `Execution Summary`, no error detail.
4. Run the same failing model alone:
```bash
dbt@2 build -s broken_model --fail-fast --target dev
```
Full error report prints correctly.
5. Run the large selection **without** `--fail-fast`:
```bash
dbt@2 build -s "*" --target dev
```
Full error report prints correctly, including all failed nodes.
The bug manifests only in step 2 — the combination of `--fail-fast` and a large selection.
### Relevant log output
```shell
```
### Environment
```markdown
- OS: macOS 26
- CPU: arm64
- dbt distribution and version: dbt-core 2.0.0-alpha.4 (pipx), BigQuery adapter (bundled)
```
### Which database adapter are you using?
bigquery
### Is this a discrepancy vs. dbt 1.x?
- [x] Yes — this works in dbt 1.x but not in dbt v2.x
### Additional Context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.