Commit 44ae5c7
Fix DbtCloudRunJobTrigger timeout error message and add final status check
The timeout error message in DbtCloudRunJobTrigger.run() printed
self.end_time (an absolute epoch timestamp) labelled as "seconds",
producing nonsensical output like "after 1771200015.8 seconds" instead
of a meaningful duration.
Additionally, the timeout check fired before sleeping, without a final
status poll. A job completing during asyncio.sleep() could be
incorrectly reported as timed out.
Changes:
- Move asyncio.sleep() before the timeout check so the trigger sleeps
first, then evaluates the deadline.
- Add a final is_still_running() call when the timeout fires so that
jobs completing at the boundary are handled correctly.
- Replace the misleading epoch-as-duration message with a clear
"within the configured timeout" message.
- Update existing timeout test and add a new test for the edge case
where a job completes at the timeout boundary.
Closes: #61979
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent a61e923 commit 44ae5c7
File tree
2 files changed
+45
-13
lines changed- providers/dbt/cloud
- src/airflow/providers/dbt/cloud/triggers
- tests/unit/dbt/cloud/triggers
2 files changed
+45
-13
lines changedLines changed: 14 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
Lines changed: 31 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
223 | 251 | | |
224 | 252 | | |
225 | 253 | | |
| |||
0 commit comments