Repository: dbt-labs/dbt-core

Issue:
--fail-fast with BigQuery does not show original error message
### Describe the bug
When using `dbt run --fail-fast` on BQ, the original passthrough error message is not present in the output logs.

```
dbt run -m +some_model --fail-fast
Running with dbt=0.17.0
Found 176 models, 1261 tests, 0 snapshots, 2 analyses, 364 macros, 0 operations, 0 seed files, 27 sources

16:32:26 | Concurrency: 8 threads (target='dev')
16:32:26 | 
16:32:26 | 1 of 4 START table model someschema.some_model........ [RUN]
16:32:27 | 1 of 4 ERROR creating table model someschema.some_model [ERROR in 1.02s]
16:32:27 | The bigquery adapter does not support query cancellation. Some queries may still be running!
Encountered an error:
FailFast Error in model some_model (models/someschema/some_model.sql)
  Failing early due to test failure or runtime error
```

### Steps To Reproduce
1. Setup a broken model in dbt against a BigQuery connection
2. Run with `dbt run --fail-fast`
3. Look at output log

### Expected behavior
We should still see the original passthrough error message prior to the `FailFast Error in...` messaging like how it does in other connection types.

This is output from another connection type where we can see the `Database Error in...` messaging present:
```
dbt run --fail-fast
Running with dbt=0.17.1
Found 1 model, 0 tests, 0 snapshots, 0 analyses, 134 macros, 0 operations, 2 seed files, 1 source
19:00:22 | Concurrency: 1 threads (target='dev')
19:00:22 |
19:00:22 | 1 of 1 START view model dbt_jcohen.bad_model......................... [RUN]
19:00:22 | 1 of 1 ERROR creating view model dbt_jcohen.bad_model................ [ERROR in 0.08s]
19:00:23 | CANCEL query model.random.bad_model.................................. [CANCEL]
Database Error in model bad_model (models/bad_model.sql)
  column "askdfhdlrgioj" does not exist
  LINE 4:     select askdfhdlrgioj
                     ^
  compiled SQL at target/run/random/models/bad_model.sql
Encountered an error:
FailFast Error in model bad_model (models/bad_model.sql)
  Failing early due to test failure or runtime error
```

### System information
**Which database are you using dbt with?**
- [ ] postgres
- [ ] redshift
- [x] bigquery
- [ ] snowflake
- [ ] other (specify: ____________)


**The output of `dbt --version`:**
```
installed version: 0.17.0
   latest version: 0.17.1

Your version of dbt is out of date! You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Plugins:
  - bigquery: 0.17.0
  - snowflake: 0.17.0
  - redshift: 0.17.0
  - postgres: 0.17.0
```

**The operating system you're using:**
macOS 10.14.6

**The output of `python --version`:**
Python 3.7.4


Discussion:
👍 
Would be really great to be able to use `--fail-fast` in production to cut down on BQ cost, while still getting full error messages to route to the right person.
Thanks for opening this, @joshpeng-quibi!

The operative lines are here: https://github.com/fishtown-analytics/dbt/blob/88e26da026eddd0c94b2bf591cf2194995c157f7/core/dbt/task/runnable.py#L181-L188

I stepped through this locally and confirmed that `result.error` does contain the appropriate database error. It just fails to eventually print out. I wonder if this is due to an odd logging interaction between `_raise_next_tick` and `_cancel_connections`, namely the `adapter.is_cancelable()` classmethod that causes the BigQuery adapter to print out:
```
The bigquery adapter does not support query cancellation. Some queries may still be running!
```

The code is tricky in places, but I believe the scope to be quite limited, so I'm tagging with "good first issue" to see if there are any community members interested in working on a fix.

Resolving patch:
diff --git a/core/dbt/task/runnable.py b/core/dbt/task/runnable.py
--- a/core/dbt/task/runnable.py
+++ b/core/dbt/task/runnable.py
@@ -295,15 +295,15 @@ def _cancel_connections(self, pool):
 
             yellow = dbt.ui.printer.COLOR_FG_YELLOW
             dbt.ui.printer.print_timestamped_line(msg, yellow)
-            raise
 
-        for conn_name in adapter.cancel_open_connections():
-            if self.manifest is not None:
-                node = self.manifest.nodes.get(conn_name)
-                if node is not None and node.is_ephemeral_model:
-                    continue
-            # if we don't have a manifest/don't have a node, print anyway.
-            dbt.ui.printer.print_cancel_line(conn_name)
+        else:
+            for conn_name in adapter.cancel_open_connections():
+                if self.manifest is not None:
+                    node = self.manifest.nodes.get(conn_name)
+                    if node is not None and node.is_ephemeral_model:
+                        continue
+                # if we don't have a manifest/don't have a node, print anyway.
+                dbt.ui.printer.print_cancel_line(conn_name)
 
         pool.join()
 


Test patch: