Skip to content

Fix DbtCloudRunJobTrigger timeout error message and add final status check#62306

Merged
jscheffl merged 1 commit into
apache:mainfrom
Vamsi-klu:fix/61979-dbt-cloud-trigger-timeout-bugs
Feb 22, 2026
Merged

Fix DbtCloudRunJobTrigger timeout error message and add final status check#62306
jscheffl merged 1 commit into
apache:mainfrom
Vamsi-klu:fix/61979-dbt-cloud-trigger-timeout-bugs

Conversation

@Vamsi-klu

Copy link
Copy Markdown
Contributor

Problem

DbtCloudRunJobTrigger.run() has two bugs that surface when a dbt Cloud job run exceeds the configured timeout (#61979):

  1. Misleading error message: The timeout error message prints the raw Unix epoch timestamp (self.end_time) instead of a meaningful value, producing nonsensical messages like "Job run 70403194297680 has not reached a terminal status after 1771200015.8 seconds." (≈ 56 years).

  2. Missing final status check: When the timeout fires, the trigger immediately yields an error without re-checking whether the job has since completed. If a job finishes between the last poll and the timeout boundary, Airflow incorrectly reports a timeout failure even though the dbt Cloud job succeeded.

Solution

  • Bug 1: Changed the error message from f"after {self.end_time} seconds." to f"within the configured timeout." since self.end_time is an absolute epoch timestamp, not a relative duration.

  • Bug 2: Added a final is_still_running() check before yielding the timeout error. If the job completed in the interim, the trigger breaks out of the while loop and falls through to the normal terminal status handling (success/cancelled/error).

Testing Done

  • Updated existing test_dbt_job_run_timeout to verify the corrected error message format.
  • Added new test_dbt_job_run_timeout_with_final_status_check test that simulates a job completing at the timeout boundary — verifies the trigger yields success instead of a false timeout error.
  • All 11 tests in providers/dbt/cloud/tests/unit/dbt/cloud/triggers/test_dbt.py pass.
  • Ruff lint and format checks pass.

Breaking Changes

None. The only user-visible change is the timeout error message text, which previously contained an incorrect value (epoch timestamp) and now says "within the configured timeout." instead.

Closes: #61979

🤖 Generated with Claude Code

…check (apache#61979)

Fix two bugs in DbtCloudRunJobTrigger.run():

1. The timeout error message displayed the raw epoch timestamp (self.end_time)
   instead of a meaningful duration, producing nonsensical messages like
   "after 1771200015.8 seconds". Changed to "within the configured timeout."

2. When the timeout expires, the trigger now performs a final is_still_running()
   check before yielding a timeout error. This prevents false timeout failures
   when a dbt Cloud job completes between the last poll and the timeout boundary.

Closes: apache#61979

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Vamsi-klu
Vamsi-klu marked this pull request as ready for review February 22, 2026 01:58
@Vamsi-klu
Vamsi-klu requested a review from josh-fell as a code owner February 22, 2026 01:58
@Vamsi-klu

Copy link
Copy Markdown
Contributor Author

cc @jscheffl @josh-fell @potiuk — Would appreciate a review on this fix for the dbt-cloud provider trigger timeout bugs reported in #61979. The changes are small and focused:

  1. Fixed the misleading timeout error message (was printing a Unix epoch timestamp as seconds)
  2. Added a final is_still_running() check before declaring timeout to prevent false failures

All existing tests pass plus one new test for the race-condition fix.

@Vamsi-klu

Copy link
Copy Markdown
Contributor Author

Collaborators for this PR: @codingrealitylabs and @girlcoder-gaming. They helped me raise this PR.

@jscheffl
jscheffl merged commit 02828c2 into apache:main Feb 22, 2026
133 of 138 checks passed
dominikhei pushed a commit to dominikhei/airflow that referenced this pull request Mar 11, 2026
…check (apache#61979) (apache#62306)

Fix two bugs in DbtCloudRunJobTrigger.run():

1. The timeout error message displayed the raw epoch timestamp (self.end_time)
   instead of a meaningful duration, producing nonsensical messages like
   "after 1771200015.8 seconds". Changed to "within the configured timeout."

2. When the timeout expires, the trigger now performs a final is_still_running()
   check before yielding a timeout error. This prevents false timeout failures
   when a dbt Cloud job completes between the last poll and the timeout boundary.

Closes: apache#61979

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Ankurdeewan pushed a commit to Ankurdeewan/airflow that referenced this pull request Mar 15, 2026
…check (apache#61979) (apache#62306)

Fix two bugs in DbtCloudRunJobTrigger.run():

1. The timeout error message displayed the raw epoch timestamp (self.end_time)
   instead of a meaningful duration, producing nonsensical messages like
   "after 1771200015.8 seconds". Changed to "within the configured timeout."

2. When the timeout expires, the trigger now performs a final is_still_running()
   check before yielding a timeout error. This prevents false timeout failures
   when a dbt Cloud job completes between the last poll and the timeout boundary.

Closes: apache#61979

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

DbtCloudRunJobTrigger: misleading timeout error message and missing final status check

2 participants