justinpakzad commented on code in PR #70103:
URL: https://github.com/apache/airflow/pull/70103#discussion_r3890929736


##########
providers/snowflake/src/airflow/providers/snowflake/operators/snowpark_containers.py:
##########
@@ -242,10 +246,47 @@ def execute(self, context: Context) -> str:
             raise RuntimeError("Job name was not returned")
         if not self.wait_for_completion:
             return self.job_name
+        if self.deferrable:
+            # timeout and execution_timeout give the trigger two separate 
deadlines. timeout caps
+            # how long the job is polled, and execution_timeout, when set, 
enforces the task-level
+            # limit. The trigger times out on whichever is reached first.
+            now = time.time()
+            poll_buffer = timedelta(seconds=self.poll_interval + 60)
+            execution_deadline = None
+            defer_timeout = timedelta(seconds=self.timeout) + poll_buffer
+            if self.execution_timeout is not None:
+                # Hand the execution deadline to the trigger so it emits a 
timeout event that drops the
+                # service. The framework's defer timeout would otherwise kill 
the task with no cleanup.
+                execution_deadline = now + 
self.execution_timeout.total_seconds()

Review Comment:
   Good find. Updated.



-- 
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