SameerMesiah97 commented on PR #61472:
URL: https://github.com/apache/airflow/pull/61472#issuecomment-4019207871

   > That looks good. Though I would feel more comfortable if I saw some output 
of running job/ screenshot showing the behaviour. Possible @SameerMesiah97 ?
   
   I used the following DAG to test the behavior of `execution_timeout` before 
and after my implementation:
   
   ```
   from airflow import DAG
   from airflow.providers.dbt.cloud.operators.dbt import DbtCloudRunJobOperator
   from datetime import datetime, timedelta
   
   with DAG(
       dag_id="dbt_deferrable_timeout_none_repro",
       start_date=datetime(2024, 1, 1),
       schedule=None,
       catchup=False,
   ) as dag:
   
       run_dbt = DbtCloudRunJobOperator(
           dbt_cloud_conn_id = "test_dbt_conn",
           task_id="run_dbt",
           job_id= **********0798,
           wait_for_termination=True,
           deferrable=True,
           execution_timeout=timedelta(seconds=30),
       )
   ```
   
   
   **Behavior before the fix**
   
   DAG run:
   <img width="1353" height="681" alt="image" 
src="https://github.com/user-attachments/assets/8996a7ff-97b4-4bf1-b69d-f4d1b5514bfd";
 />
   
   Job run status after `execution_timeout` period (30s) has elapsed:
   <img width="1121" height="761" alt="image" 
src="https://github.com/user-attachments/assets/c2259506-5997-4814-84e6-1b69edfa6a4b";
 />
   
   You can see that the job keeps running even after the timeout period. 
   
   **Behavior after the fix**
   
   DAG run:
   <img width="1663" height="841" alt="image" 
src="https://github.com/user-attachments/assets/d76eedbc-11ef-4fb6-bbe6-fef527cfda73";
 />
   
   Job run status after `execution_timeout` period (30s) has elapsed:
   <img width="1353" height="817" alt="image" 
src="https://github.com/user-attachments/assets/15ce77ab-862f-491a-8661-f8ed238b5e7f";
 />
   
   The Job is cancelled via a request by the operator due to my implementation.
   
   _Note: Only the last 4 digits of the JOB ID and RUN ID have been provided 
for security reasons but it should be sufficient for you to match the DAG runs 
to the Job runs. Additional private information has been blacked out as well 
for the same reason._ 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to